@pingux/astro 1.2.0-alpha.9 → 1.3.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/CHANGELOG.md +81 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.js +35 -22
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +148 -169
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +25 -30
- package/lib/cjs/components/AccordionGridItem/AccordionGridItem.js +29 -14
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +8 -5
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +20 -17
- package/lib/cjs/components/AccordionGroup/AccordionGroup.js +2 -1
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +20 -1
- package/lib/cjs/components/ArrayField/ArrayField.js +213 -0
- package/lib/cjs/components/ArrayField/ArrayField.stories.js +223 -0
- package/lib/cjs/components/ArrayField/ArrayField.test.js +208 -0
- package/lib/cjs/components/ArrayField/ArrayFieldDeleteButton.js +61 -0
- package/lib/cjs/components/ArrayField/index.js +27 -0
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.stories.js +3 -3
- package/lib/cjs/components/Button/Button.js +14 -2
- package/lib/cjs/components/Button/Button.stories.js +33 -33
- package/lib/cjs/components/CheckboxField/CheckboxField.js +4 -1
- package/lib/cjs/components/CodeView/CodeView.js +3 -3
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +5 -3
- package/lib/cjs/components/Input/Input.js +3 -11
- package/lib/cjs/components/Input/Input.test.js +14 -2
- package/lib/cjs/components/Link/Link.js +2 -1
- package/lib/cjs/components/ListView/ListView.js +9 -13
- package/lib/cjs/components/ListView/ListView.stories.js +3 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.js +15 -3
- package/lib/cjs/components/Loader/Loader.stories.js +3 -3
- package/lib/cjs/components/Modal/Modal.js +3 -0
- package/lib/cjs/components/Modal/Modal.stories.js +12 -67
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +10 -2
- package/lib/cjs/components/NavBar/NavBar.js +30 -4
- package/lib/cjs/components/NavBar/NavBar.stories.js +70 -463
- package/lib/cjs/components/NavBar/NavBar.test.js +51 -1
- package/lib/cjs/components/NavBarSection/NavBarItem.js +137 -0
- package/lib/cjs/components/NavBarSection/NavBarItemButton.js +96 -0
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +1 -1
- package/lib/cjs/components/NavBarSection/NavBarItemLink.js +98 -0
- package/lib/cjs/components/NavBarSection/NavBarSection.js +10 -8
- package/lib/cjs/components/NavBarSection/index.js +28 -1
- package/lib/cjs/components/NumberField/NumberField.js +30 -10
- package/lib/cjs/components/NumberField/NumberField.test.js +7 -0
- package/lib/cjs/components/PageHeader/PageHeader.js +3 -0
- package/lib/cjs/components/PageHeader/PageHeader.stories.js +6 -1
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +9 -5
- package/lib/cjs/components/RockerButton/RockerButton.js +14 -22
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.js +5 -9
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.stories.js +4 -22
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.test.js +5 -14
- package/lib/cjs/components/SearchField/SearchField.stories.js +1 -15
- package/lib/cjs/components/SelectField/SelectField.stories.js +3 -55
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +8 -1
- package/lib/cjs/components/Tabs/Tabs.stories.js +1 -15
- package/lib/cjs/components/TextAreaField/TextAreaField.js +54 -9
- package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +31 -52
- package/lib/cjs/components/TextAreaField/TextAreaField.test.js +12 -0
- package/lib/cjs/context/AccordionGridContext/index.js +20 -0
- package/lib/cjs/context/NavBarContext/index.js +20 -0
- package/lib/cjs/hooks/index.js +9 -0
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
- package/lib/cjs/hooks/useField/useField.js +7 -2
- package/lib/cjs/{components/AccordionGridGroup/AccordionGridContext.js → hooks/useNavBarPress/index.js} +7 -6
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.js +38 -0
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.test.js +42 -0
- package/lib/cjs/hooks/useRockerButton/useRockerButton.js +4 -6
- package/lib/cjs/index.js +80 -58
- package/lib/cjs/recipes/ConditionalFilter.stories.js +7 -3
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +1 -1
- package/lib/cjs/styles/forms/checkbox.js +0 -1
- package/lib/cjs/styles/forms/input.js +1 -1
- package/lib/cjs/styles/forms/label.js +3 -0
- package/lib/cjs/styles/forms/radio.js +1 -1
- package/lib/cjs/styles/forms/switch.js +3 -1
- package/lib/cjs/styles/variants/accordion.js +39 -7
- package/lib/cjs/styles/variants/boxes.js +14 -25
- package/lib/cjs/styles/variants/buttons.js +27 -1
- package/lib/cjs/styles/variants/codeView.js +91 -0
- package/lib/cjs/styles/variants/navBar.js +68 -0
- package/lib/cjs/styles/variants/separator.js +2 -1
- package/lib/cjs/styles/variants/text.js +3 -1
- package/lib/cjs/styles/variants/variants.js +3 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.js +35 -22
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +143 -166
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +24 -25
- package/lib/components/AccordionGridItem/AccordionGridItem.js +29 -15
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +8 -6
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +22 -18
- package/lib/components/AccordionGroup/AccordionGroup.js +2 -1
- package/lib/components/AccordionGroup/AccordionGroup.test.js +16 -2
- package/lib/components/ArrayField/ArrayField.js +179 -0
- package/lib/components/ArrayField/ArrayField.stories.js +196 -0
- package/lib/components/ArrayField/ArrayField.test.js +185 -0
- package/lib/components/ArrayField/ArrayFieldDeleteButton.js +43 -0
- package/lib/components/ArrayField/index.js +2 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +3 -3
- package/lib/components/Button/Button.js +15 -3
- package/lib/components/Button/Button.stories.js +17 -15
- package/lib/components/CheckboxField/CheckboxField.js +4 -1
- package/lib/components/CodeView/CodeView.js +2 -2
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +5 -3
- package/lib/components/Input/Input.js +2 -10
- package/lib/components/Input/Input.test.js +11 -2
- package/lib/components/Link/Link.js +2 -1
- package/lib/components/ListView/ListView.js +9 -12
- package/lib/components/ListView/ListView.stories.js +3 -0
- package/lib/components/ListViewItem/ListViewItem.js +14 -3
- package/lib/components/Loader/Loader.stories.js +1 -1
- package/lib/components/Modal/Modal.js +4 -1
- package/lib/components/Modal/Modal.stories.js +11 -60
- package/lib/components/MultivaluesField/MultivaluesField.js +9 -2
- package/lib/components/NavBar/NavBar.js +25 -4
- package/lib/components/NavBar/NavBar.stories.js +71 -462
- package/lib/components/NavBar/NavBar.test.js +39 -2
- package/lib/components/NavBarSection/NavBarItem.js +111 -0
- package/lib/components/NavBarSection/NavBarItemButton.js +69 -0
- package/lib/components/NavBarSection/NavBarItemHeader.js +1 -1
- package/lib/components/NavBarSection/NavBarItemLink.js +71 -0
- package/lib/components/NavBarSection/NavBarSection.js +9 -8
- package/lib/components/NavBarSection/index.js +4 -1
- package/lib/components/NumberField/NumberField.js +32 -12
- package/lib/components/NumberField/NumberField.test.js +5 -0
- package/lib/components/PageHeader/PageHeader.js +2 -0
- package/lib/components/PageHeader/PageHeader.stories.js +5 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +9 -5
- package/lib/components/RockerButton/RockerButton.js +14 -21
- package/lib/components/RockerButtonGroup/RockerButtonGroup.js +5 -9
- package/lib/components/RockerButtonGroup/RockerButtonGroup.stories.js +2 -17
- package/lib/components/RockerButtonGroup/RockerButtonGroup.test.js +5 -11
- package/lib/components/SearchField/SearchField.stories.js +0 -11
- package/lib/components/SelectField/SelectField.stories.js +2 -50
- package/lib/components/SelectFieldBase/SelectFieldBase.js +8 -1
- package/lib/components/Tabs/Tabs.stories.js +0 -11
- package/lib/components/TextAreaField/TextAreaField.js +54 -10
- package/lib/components/TextAreaField/TextAreaField.stories.js +26 -42
- package/lib/components/TextAreaField/TextAreaField.test.js +13 -0
- package/lib/context/AccordionGridContext/index.js +5 -0
- package/lib/context/NavBarContext/index.js +5 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
- package/lib/hooks/useField/useField.js +7 -2
- package/lib/hooks/useNavBarPress/index.js +1 -0
- package/lib/hooks/useNavBarPress/useNavBarPress.js +27 -0
- package/lib/hooks/useNavBarPress/useNavBarPress.test.js +36 -0
- package/lib/hooks/useRockerButton/useRockerButton.js +4 -6
- package/lib/index.js +2 -0
- package/lib/recipes/ConditionalFilter.stories.js +7 -3
- package/lib/recipes/RadioButtonsWithLinks.stories.js +1 -1
- package/lib/styles/forms/checkbox.js +0 -1
- package/lib/styles/forms/input.js +1 -1
- package/lib/styles/forms/label.js +3 -0
- package/lib/styles/forms/radio.js +1 -1
- package/lib/styles/forms/switch.js +3 -1
- package/lib/styles/variants/accordion.js +26 -5
- package/lib/styles/variants/boxes.js +14 -25
- package/lib/styles/variants/buttons.js +27 -1
- package/lib/styles/variants/codeView.js +91 -0
- package/lib/styles/variants/navBar.js +46 -0
- package/lib/styles/variants/separator.js +2 -1
- package/lib/styles/variants/text.js +3 -1
- package/lib/styles/variants/variants.js +2 -0
- package/package.json +4 -2
- package/lib/cjs/layouts/ListLayout.stories.js +0 -895
- package/lib/cjs/layouts/SchemaFormLayout.stories.js +0 -139
- package/lib/cjs/recipes/ArrayField.stories.js +0 -169
- package/lib/components/AccordionGridGroup/AccordionGridContext.js +0 -2
- package/lib/layouts/ListLayout.stories.js +0 -866
- package/lib/layouts/SchemaFormLayout.stories.js +0 -107
- package/lib/recipes/ArrayField.stories.js +0 -134
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,87 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.3.1](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.3.0...@pingux/astro@1.3.1) (2022-03-01)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* [UIP-5110] Remove ListLayout and SchemaLayout stories ([e0ac22b](https://gitlab.corp.pingidentity.com/ux/pingux/commit/e0ac22b4b0d9134edd4dd7c76e92926b33d62962))
|
12
|
+
* [UIP-5152] Deprecate page header component ([a7cf8d6](https://gitlab.corp.pingidentity.com/ux/pingux/commit/a7cf8d6a507805e54a5c3c6bcf047102d2b3813d))
|
13
|
+
* [UIP-5178] NumberField - Spec Update ([0e6a2b7](https://gitlab.corp.pingidentity.com/ux/pingux/commit/0e6a2b79799edf4e9b52bf580ca45043c1b810dc))
|
14
|
+
* [UIP-5212] RadioField and CheckboxField Spacing Update ([b6e8cb4](https://gitlab.corp.pingidentity.com/ux/pingux/commit/b6e8cb47e783c52caff04eb61518e5db15b4479f))
|
15
|
+
* [UIP-5226] MultivaluesField allow props to be spread into TextField ([8806276](https://gitlab.corp.pingidentity.com/ux/pingux/commit/8806276c62bf4ea9cf5d4454fb57a61ec313e375))
|
16
|
+
* [UIP-5241] Switch Label Text and Spacing Updates ([d79f7a4](https://gitlab.corp.pingidentity.com/ux/pingux/commit/d79f7a415b109b9d407677e15614464a34e6fdf8))
|
17
|
+
* [UIP-5244] SelectField Storybook Updates ([a0391ea](https://gitlab.corp.pingidentity.com/ux/pingux/commit/a0391ea2b17ed9c8d0fd7f21ab535d5305f6e233))
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
# [1.3.0](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.2.1...@pingux/astro@1.3.0) (2022-02-23)
|
24
|
+
|
25
|
+
|
26
|
+
### Bug Fixes
|
27
|
+
|
28
|
+
* [UIP-4969] Update astro tab font size ([7af5410](https://gitlab.corp.pingidentity.com/ux/pingux/commit/7af54107825154d795ecb97143fc24364c9b225c))
|
29
|
+
* [UIP-5146] Loader Story Update - Change "Loader With Most Common Color" to "Custom Color" ([78fbdd9](https://gitlab.corp.pingidentity.com/ux/pingux/commit/78fbdd938ce5b0a3f87f7821599caf3967c3389b))
|
30
|
+
* [UIP-5150] Modal Storybook Improvements ([4a9bd28](https://gitlab.corp.pingidentity.com/ux/pingux/commit/4a9bd28aa9f804cd51cc3a89fd0467ddfd3a2327))
|
31
|
+
* [UIP-5225] Add accessible theme for CodeView using JS styles ([6659da6](https://gitlab.corp.pingidentity.com/ux/pingux/commit/6659da6743dd68886750d3c58465b36ad6b551c0))
|
32
|
+
* [UIP-5281] NavBar improvements and design review changes ([f8bd0ac](https://gitlab.corp.pingidentity.com/ux/pingux/commit/f8bd0acd6bcedfc92ac7a6615e4b79b19d1fbe9e))
|
33
|
+
|
34
|
+
|
35
|
+
### Features
|
36
|
+
|
37
|
+
* [UIP-4607] Array field component ([8cca040](https://gitlab.corp.pingidentity.com/ux/pingux/commit/8cca04033e330af5838b38f45e441464900db810))
|
38
|
+
* [UIP-5228] Add Storysource and Console addons to Astro ([a96de8c](https://gitlab.corp.pingidentity.com/ux/pingux/commit/a96de8cf5c557e74b400ada232caf58974e927cb))
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
## [1.2.1](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.2.0...@pingux/astro@1.2.1) (2022-02-16)
|
45
|
+
|
46
|
+
|
47
|
+
### Bug Fixes
|
48
|
+
|
49
|
+
* Applying changes to updated packages for so the version fixes are applied ([16b2e91](https://gitlab.corp.pingidentity.com/ux/pingux/commit/16b2e916f5926678d613f85725f6ec7e86fd359d))
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
# [1.2.0](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.1.0...@pingux/astro@1.2.0) (2022-02-15)
|
56
|
+
|
57
|
+
|
58
|
+
### Bug Fixes
|
59
|
+
|
60
|
+
* [UIP-5062] Deprecate danger and text button variants ([c69e7a4](https://gitlab.corp.pingidentity.com/ux/pingux/commit/c69e7a4230bb986eebe5aa35f52b978f8e08f932))
|
61
|
+
* [UIP-5112] import messages reducer from index.js ([d1d7d5b](https://gitlab.corp.pingidentity.com/ux/pingux/commit/d1d7d5bbfd38b1cea48c01185b9cbded5f563bb4))
|
62
|
+
* [UIP-5116] Add content slots to TextAreaField ([43eecd7](https://gitlab.corp.pingidentity.com/ux/pingux/commit/43eecd703e9bc7dc8f8b7997cccc314a38a3fe09))
|
63
|
+
* [UIP-5170] Fix broken RockerButtonGroup and incorrect deps in yarn.lock ([89cb5ee](https://gitlab.corp.pingidentity.com/ux/pingux/commit/89cb5ee7638352e9f8781cd9449fd5edc85d74f4))
|
64
|
+
* [UIP-5179] Multivalues Chip Spacing Improvements ([c1fc4bc](https://gitlab.corp.pingidentity.com/ux/pingux/commit/c1fc4bce4133b48e3994003f6a74fe67d934104c))
|
65
|
+
* [UIP-5183] Link has incorrect styling ([434b144](https://gitlab.corp.pingidentity.com/ux/pingux/commit/434b1447870cfc729b71bcdfc13abc575ead9ad7))
|
66
|
+
* [UIP-5185] NumberField doesn't seem to accept 'name' prop ([67aa25b](https://gitlab.corp.pingidentity.com/ux/pingux/commit/67aa25bf0c055348b290709d963dad16b2b22223))
|
67
|
+
* [UIP-5217] Input Field in Accordion Clickable ([83f13d3](https://gitlab.corp.pingidentity.com/ux/pingux/commit/83f13d395fca2d1a19bbe877dfd62e52f37402ca))
|
68
|
+
* [UIP-5224] Remove .css file dependency for CodeView component ([73a0a89](https://gitlab.corp.pingidentity.com/ux/pingux/commit/73a0a899c4c2891c066c1c52b164edc8cc882fa4))
|
69
|
+
* [UIP-5230] OverlayPanel Content Jump ([67c26b5](https://gitlab.corp.pingidentity.com/ux/pingux/commit/67c26b53a9b8f5c40b16b44cbde2ef174b1885f0))
|
70
|
+
* [UIP-5245] TextFieldArea Default Rows and Story Update ([30b65cc](https://gitlab.corp.pingidentity.com/ux/pingux/commit/30b65cc38eebdb8a7d0d1f00307e7a0d3518c2ee))
|
71
|
+
* Update dependencies for fbjs, lodash, and prism-react-renderer ([fcd37bd](https://gitlab.corp.pingidentity.com/ux/pingux/commit/fcd37bd01bdabe534aec41333ea56ab383e010a5))
|
72
|
+
|
73
|
+
|
74
|
+
### Features
|
75
|
+
|
76
|
+
* [UIP-4870] Environment Breadcrumb ([e4b1af2](https://gitlab.corp.pingidentity.com/ux/pingux/commit/e4b1af226a716e97981f7ad6ba34e452b6b2fdb5))
|
77
|
+
* [UIP-5135] Function to generate mock data ([8513974](https://gitlab.corp.pingidentity.com/ux/pingux/commit/8513974d229642a0c945ba5de4fbd8445587a0f4))
|
78
|
+
* [UIP-5158] Input Field - Add Story with Copy Button & Slots ([8726f94](https://gitlab.corp.pingidentity.com/ux/pingux/commit/8726f949c5ae657c4eaafc7983735d969d93d724))
|
79
|
+
* [UIP-5164] Color Block Button Variant ([ed3a13b](https://gitlab.corp.pingidentity.com/ux/pingux/commit/ed3a13b58d5692dd90abe8b1f878a30b2ced1e3f))
|
80
|
+
* [UIP-5187] HelpHint styling does not match spec and needs story ([6ec1cd1](https://gitlab.corp.pingidentity.com/ux/pingux/commit/6ec1cd1d99f9a371af9dbef266a5ad31fdce53f0))
|
81
|
+
* [UIP-5210] Filter Variant for Button ([b9e2a9d](https://gitlab.corp.pingidentity.com/ux/pingux/commit/b9e2a9d2d64852bc2af2b0fea6759ac5fc4d5623))
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
6
87
|
# [1.1.0](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.1.0-alpha.12...@pingux/astro@1.1.0) (2022-02-02)
|
7
88
|
|
8
89
|
|
@@ -50,7 +50,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
50
50
|
|
51
51
|
var _i18n = require("@react-aria/i18n");
|
52
52
|
|
53
|
-
var _AccordionGridContext = require("
|
53
|
+
var _AccordionGridContext = require("../../context/AccordionGridContext");
|
54
54
|
|
55
55
|
var _AccordionGridItem = _interopRequireDefault(require("../AccordionGridItem"));
|
56
56
|
|
@@ -85,8 +85,7 @@ var AccordionGridGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
|
|
85
85
|
var _context2;
|
86
86
|
|
87
87
|
var disabledKeys = props.disabledKeys,
|
88
|
-
|
89
|
-
onSelectionChange = props.onSelectionChange;
|
88
|
+
containerProps = props.containerProps;
|
90
89
|
var accordionGridRef = (0, _react.useRef)();
|
91
90
|
/* istanbul ignore next */
|
92
91
|
|
@@ -111,9 +110,11 @@ var AccordionGridGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
|
|
111
110
|
columnCount: 1,
|
112
111
|
items: (0, _map["default"])(_context = (0, _from["default"])(collection)).call(_context, function (item) {
|
113
112
|
return _objectSpread(_objectSpread({}, item), {}, {
|
113
|
+
key: "row-".concat(item.key),
|
114
114
|
hasChildNodes: true,
|
115
115
|
childNodes: [{
|
116
|
-
key:
|
116
|
+
key: item.key,
|
117
|
+
// use key for first cell, fixes selection after changes from UIP-5170
|
117
118
|
type: 'cell',
|
118
119
|
index: 0,
|
119
120
|
value: null,
|
@@ -139,12 +140,11 @@ var AccordionGridGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
|
|
139
140
|
}, [collection]);
|
140
141
|
var state = (0, _grid.useGridState)(_objectSpread(_objectSpread({}, props), {}, {
|
141
142
|
disabledKeys: disabledKeys,
|
142
|
-
selectedKeys: selectedKeys,
|
143
143
|
collection: gridCollection,
|
144
|
-
selectionMode: 'multiple'
|
145
|
-
|
146
|
-
|
147
|
-
|
144
|
+
selectionMode: 'multiple'
|
145
|
+
})); // Required to enable header selection
|
146
|
+
|
147
|
+
state.selectionManager.allowsCellSelection = true;
|
148
148
|
var keyboardDelegate = (0, _react.useMemo)(function () {
|
149
149
|
return new _grid2.GridKeyboardDelegate({
|
150
150
|
collection: state.collection,
|
@@ -157,7 +157,6 @@ var AccordionGridGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
|
|
157
157
|
}, [state, accordionGridRef, direction, collator]);
|
158
158
|
|
159
159
|
var _useGrid = (0, _grid2.useGrid)(_objectSpread(_objectSpread({}, props), {}, {
|
160
|
-
isVirtualized: true,
|
161
160
|
keyboardDelegate: keyboardDelegate
|
162
161
|
}), state, accordionGridRef),
|
163
162
|
gridProps = _useGrid.gridProps;
|
@@ -167,7 +166,7 @@ var AccordionGridGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
|
|
167
166
|
state: state,
|
168
167
|
keyboardDelegate: keyboardDelegate
|
169
168
|
}
|
170
|
-
}, (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({}, (0, _utils.mergeProps)(gridProps), {
|
169
|
+
}, (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({}, (0, _utils.mergeProps)(gridProps, containerProps), {
|
171
170
|
ref: accordionGridRef
|
172
171
|
}), (0, _map["default"])(_context2 = (0, _from["default"])(state.collection)).call(_context2, function (item) {
|
173
172
|
return (0, _react2.jsx)(_AccordionGridItem["default"], (0, _extends2["default"])({
|
@@ -177,6 +176,27 @@ var AccordionGridGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
|
|
177
176
|
})));
|
178
177
|
});
|
179
178
|
AccordionGridGroup.propTypes = {
|
179
|
+
/**
|
180
|
+
* The currently selected keys in the collection (uncontrolled).
|
181
|
+
*
|
182
|
+
* `selectedKeys="all"` can be used to select every key.
|
183
|
+
*/
|
184
|
+
defaultSelectedKeys: _isIterable.isIterableProp,
|
185
|
+
|
186
|
+
/**
|
187
|
+
* The currently selected keys in the collection (controlled).
|
188
|
+
*
|
189
|
+
* `selectedKeys="all"` can be used to select every key.
|
190
|
+
*/
|
191
|
+
selectedKeys: _isIterable.isIterableProp,
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Callback function that fires when the selected key changes.
|
195
|
+
*
|
196
|
+
* `(selectedKeys: Set) => void`
|
197
|
+
*/
|
198
|
+
onSelectionChange: _propTypes["default"].func,
|
199
|
+
|
180
200
|
/**
|
181
201
|
* The item keys that are disabled. These items cannot be selected, focused, or otherwise
|
182
202
|
* interacted with.
|
@@ -189,6 +209,9 @@ AccordionGridGroup.propTypes = {
|
|
189
209
|
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
190
210
|
id: _propTypes["default"].string,
|
191
211
|
|
212
|
+
/** Props object that is spread directly into the root (top-level) element. */
|
213
|
+
containerProps: _propTypes["default"].shape({}),
|
214
|
+
|
192
215
|
/** Defines a string value that labels the current element. */
|
193
216
|
'aria-label': _propTypes["default"].string,
|
194
217
|
|
@@ -202,17 +225,7 @@ AccordionGridGroup.propTypes = {
|
|
202
225
|
* Identifies the element (or elements) that provide a detailed, extended description for
|
203
226
|
* the object.
|
204
227
|
*/
|
205
|
-
'aria-details': _propTypes["default"].string
|
206
|
-
|
207
|
-
/**
|
208
|
-
* The currently selected keys in the collection (controlled).
|
209
|
-
*
|
210
|
-
* `selectedKeys="all"` can be used to select every key.
|
211
|
-
*/
|
212
|
-
selectedKeys: _isIterable.isIterableProp,
|
213
|
-
|
214
|
-
/** Callback function that fires when the selected key changes. */
|
215
|
-
onSelectionChange: _propTypes["default"].func
|
228
|
+
'aria-details': _propTypes["default"].string
|
216
229
|
};
|
217
230
|
AccordionGridGroup.defaultProps = {
|
218
231
|
'aria-label': 'accordion'
|
@@ -10,12 +10,12 @@ _Object$defineProperty(exports, "__esModule", {
|
|
10
10
|
value: true
|
11
11
|
});
|
12
12
|
|
13
|
-
exports.Default = exports["default"] = void 0;
|
14
|
-
|
15
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
13
|
+
exports.Controlled = exports.Default = exports["default"] = void 0;
|
16
14
|
|
17
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
18
16
|
|
17
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
18
|
+
|
19
19
|
var _react = _interopRequireWildcard(require("react"));
|
20
20
|
|
21
21
|
var _collections = require("@react-stately/collections");
|
@@ -97,188 +97,167 @@ var _default = {
|
|
97
97
|
};
|
98
98
|
exports["default"] = _default;
|
99
99
|
|
100
|
-
var
|
101
|
-
var
|
102
|
-
|
103
|
-
|
104
|
-
|
100
|
+
var Header = function Header(props) {
|
101
|
+
var item = props.item;
|
102
|
+
return (0, _react2.jsx)(_index.Box, {
|
103
|
+
isRow: true,
|
104
|
+
sx: {
|
105
|
+
flexGrow: 1
|
106
|
+
}
|
107
|
+
}, (0, _react2.jsx)(_index.Box, {
|
108
|
+
isRow: true,
|
109
|
+
alignSelf: "center",
|
110
|
+
sx: {
|
111
|
+
flexGrow: 1,
|
112
|
+
width: '50%'
|
113
|
+
}
|
114
|
+
}, (0, _react2.jsx)(_index.Text, {
|
115
|
+
sx: {
|
116
|
+
fontWeight: 3,
|
117
|
+
textOverflow: 'ellipsis',
|
118
|
+
whiteSpace: 'nowrap',
|
119
|
+
overflow: 'hidden'
|
120
|
+
},
|
121
|
+
variant: "itemTitle",
|
122
|
+
alignSelf: "center"
|
123
|
+
}, item.name)), (0, _react2.jsx)(_index.Box, {
|
124
|
+
isRow: true,
|
125
|
+
alignSelf: "center",
|
126
|
+
sx: {
|
127
|
+
flexGrow: 1,
|
128
|
+
width: '50%'
|
129
|
+
}
|
130
|
+
}, (0, _react2.jsx)(_index.Text, {
|
131
|
+
sx: {
|
132
|
+
fontWeight: 0,
|
133
|
+
textOverflow: 'ellipsis',
|
134
|
+
whiteSpace: 'nowrap',
|
135
|
+
overflow: 'hidden'
|
136
|
+
},
|
137
|
+
alignSelf: "center"
|
138
|
+
}, item.organizations.length, " Organizations"), (0, _react2.jsx)(_index.Box, {
|
139
|
+
isRow: true,
|
140
|
+
alignSelf: "center",
|
141
|
+
sx: {
|
142
|
+
ml: 'auto'
|
143
|
+
}
|
144
|
+
}, (0, _react2.jsx)(_index.IconButton, {
|
145
|
+
"aria-label": "create-icon",
|
146
|
+
sx: {
|
147
|
+
mr: '4px',
|
148
|
+
height: '26px',
|
149
|
+
width: '26px'
|
150
|
+
}
|
151
|
+
}, (0, _react2.jsx)(_CreateIcon["default"], null)), (0, _react2.jsx)(_index.IconButton, {
|
152
|
+
"aria-label": "vertical-lines-icon",
|
153
|
+
sx: {
|
154
|
+
mr: '4px',
|
155
|
+
height: '26px',
|
156
|
+
width: '26px'
|
157
|
+
}
|
158
|
+
}, (0, _react2.jsx)(_MoreVertIcon["default"], null)))));
|
159
|
+
};
|
160
|
+
|
161
|
+
var Body = function Body(props) {
|
162
|
+
var _context;
|
163
|
+
|
164
|
+
var item = props.item;
|
165
|
+
return (0, _react2.jsx)(_index.Box, {
|
166
|
+
isRow: true
|
167
|
+
}, (0, _react2.jsx)(_index.Box, {
|
168
|
+
sx: {
|
169
|
+
flexGrow: 1,
|
170
|
+
width: 'calc(50% - 20px)'
|
171
|
+
}
|
172
|
+
}, (0, _react2.jsx)(_index.Link, {
|
173
|
+
"aria-label": "permissions",
|
174
|
+
variant: "link",
|
175
|
+
sx: {
|
176
|
+
marginTop: '15px',
|
177
|
+
whiteSpace: 'nowrap',
|
178
|
+
overflow: 'hidden',
|
179
|
+
textOverflow: 'ellipsis',
|
180
|
+
textDecoration: 'none'
|
181
|
+
},
|
182
|
+
href: "https://www.pingidentity.com",
|
183
|
+
target: "_blank"
|
184
|
+
}, "View permissions")), (0, _react2.jsx)(_index.Box, {
|
185
|
+
sx: {
|
186
|
+
flexGrow: 1,
|
187
|
+
width: '50%'
|
188
|
+
}
|
189
|
+
}, (0, _map["default"])(_context = item.organizations).call(_context, function (org) {
|
190
|
+
var _context2;
|
105
191
|
|
106
|
-
var Header = function Header(props) {
|
107
|
-
var item = props.item;
|
108
192
|
return (0, _react2.jsx)(_index.Box, {
|
109
|
-
|
193
|
+
key: "box".concat(org.name),
|
110
194
|
sx: {
|
111
|
-
|
112
|
-
|
113
|
-
}, (0, _react2.jsx)(_index.Box, {
|
114
|
-
isRow: true,
|
115
|
-
alignSelf: "center",
|
116
|
-
sx: {
|
117
|
-
flexGrow: 1,
|
118
|
-
width: '50%'
|
119
|
-
}
|
120
|
-
}, (0, _react2.jsx)(_index.Text, {
|
121
|
-
sx: {
|
122
|
-
fontWeight: 3,
|
123
|
-
textOverflow: 'ellipsis',
|
124
|
-
whiteSpace: 'nowrap',
|
125
|
-
overflow: 'hidden'
|
126
|
-
},
|
127
|
-
variant: "itemTitle",
|
128
|
-
alignSelf: "center"
|
129
|
-
}, item.name)), (0, _react2.jsx)(_index.Box, {
|
130
|
-
isRow: true,
|
131
|
-
alignSelf: "center",
|
132
|
-
sx: {
|
133
|
-
flexGrow: 1,
|
134
|
-
width: '50%'
|
195
|
+
marginTop: '15px',
|
196
|
+
mb: '15px'
|
135
197
|
}
|
136
198
|
}, (0, _react2.jsx)(_index.Text, {
|
137
199
|
sx: {
|
138
|
-
fontWeight: 0,
|
139
200
|
textOverflow: 'ellipsis',
|
140
201
|
whiteSpace: 'nowrap',
|
141
202
|
overflow: 'hidden'
|
142
203
|
},
|
143
|
-
|
144
|
-
},
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
"aria-label": "vertical-lines-icon",
|
159
|
-
sx: {
|
160
|
-
mr: '4px',
|
161
|
-
height: '26px',
|
162
|
-
width: '26px'
|
163
|
-
}
|
164
|
-
}, (0, _react2.jsx)(_MoreVertIcon["default"], null)))));
|
165
|
-
};
|
166
|
-
|
167
|
-
var Body = function Body(props) {
|
168
|
-
var _context;
|
204
|
+
key: "text".concat(org.name)
|
205
|
+
}, org.name), (0, _map["default"])(_context2 = org.populations).call(_context2, function (pop) {
|
206
|
+
return (0, _react2.jsx)(_index.Text, {
|
207
|
+
key: pop,
|
208
|
+
sx: {
|
209
|
+
marginLeft: 'md',
|
210
|
+
mt: '10px',
|
211
|
+
textOverflow: 'ellipsis',
|
212
|
+
whiteSpace: 'nowrap',
|
213
|
+
overflow: 'hidden'
|
214
|
+
}
|
215
|
+
}, pop, ")");
|
216
|
+
}));
|
217
|
+
})));
|
218
|
+
};
|
169
219
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
}, (0, _react2.jsx)(_index.Box, {
|
220
|
+
var Default = function Default() {
|
221
|
+
return (// See story source for info about the data used
|
222
|
+
(0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.Text, {
|
174
223
|
sx: {
|
175
|
-
|
176
|
-
|
224
|
+
fontWeight: 3,
|
225
|
+
fontSize: '13px'
|
177
226
|
}
|
178
|
-
}, (0, _react2.jsx)(_index.
|
179
|
-
"aria-label": "permissions",
|
180
|
-
variant: "link",
|
181
|
-
sx: {
|
182
|
-
marginTop: '15px',
|
183
|
-
whiteSpace: 'nowrap',
|
184
|
-
overflow: 'hidden',
|
185
|
-
textOverflow: 'ellipsis',
|
186
|
-
textDecoration: 'none'
|
187
|
-
},
|
188
|
-
href: "https://www.pingidentity.com",
|
189
|
-
target: "_blank"
|
190
|
-
}, "View permissions")), (0, _react2.jsx)(_index.Box, {
|
227
|
+
}, "Role"), (0, _react2.jsx)(_index.Separator, {
|
191
228
|
sx: {
|
192
|
-
|
193
|
-
width: '50%'
|
229
|
+
mb: 0
|
194
230
|
}
|
195
|
-
}, (0,
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
231
|
+
}), (0, _react2.jsx)(_AccordionGridGroup["default"], {
|
232
|
+
items: data,
|
233
|
+
defaultSelectedKeys: ['Environment']
|
234
|
+
}, function (item) {
|
235
|
+
return (0, _react2.jsx)(_collections.Item, {
|
236
|
+
key: item.key,
|
237
|
+
textValue: item.name
|
238
|
+
}, (0, _react2.jsx)(Header, {
|
239
|
+
item: item
|
240
|
+
}), (0, _react2.jsx)(Body, {
|
241
|
+
item: item
|
242
|
+
}), item.key !== 'Organization' ? (0, _react2.jsx)(_index.Separator, {
|
200
243
|
sx: {
|
201
|
-
|
202
|
-
|
244
|
+
m: 0,
|
245
|
+
bg: 'neutral.90'
|
203
246
|
}
|
204
|
-
}
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
mt: '10px',
|
217
|
-
textOverflow: 'ellipsis',
|
218
|
-
whiteSpace: 'nowrap',
|
219
|
-
overflow: 'hidden'
|
220
|
-
}
|
221
|
-
}, pop, ")");
|
222
|
-
}));
|
223
|
-
})));
|
224
|
-
};
|
247
|
+
}) : null);
|
248
|
+
}))
|
249
|
+
);
|
250
|
+
};
|
251
|
+
|
252
|
+
exports.Default = Default;
|
253
|
+
|
254
|
+
var Controlled = function Controlled() {
|
255
|
+
var _useState = (0, _react.useState)(['Client']),
|
256
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
257
|
+
selectedKeys = _useState2[0],
|
258
|
+
setSelectedKeys = _useState2[1];
|
225
259
|
|
226
|
-
return (//
|
227
|
-
// {
|
228
|
-
// name: 'Client Application Developer',
|
229
|
-
// key: '1',
|
230
|
-
// organizations: [
|
231
|
-
// {
|
232
|
-
// name: 'Montana (Environment)',
|
233
|
-
// populations: [
|
234
|
-
// 'Administrators (Population)',
|
235
|
-
// 'Other Population (Population)',
|
236
|
-
// ],
|
237
|
-
// },
|
238
|
-
// {
|
239
|
-
// name: 'Boston (Environment)',
|
240
|
-
// populations: [
|
241
|
-
// ],
|
242
|
-
// },
|
243
|
-
// ],
|
244
|
-
// },
|
245
|
-
// {
|
246
|
-
// name: 'Environment Admin',
|
247
|
-
// key: '2',
|
248
|
-
// organizations: [
|
249
|
-
// {
|
250
|
-
// name: 'Montana (Environment)',
|
251
|
-
// populations: [
|
252
|
-
// 'Administrators (Population)',
|
253
|
-
// 'Other Population (Population)',
|
254
|
-
// ],
|
255
|
-
// },
|
256
|
-
// {
|
257
|
-
// name: 'Boston (Environment)',
|
258
|
-
// populations: [
|
259
|
-
// ],
|
260
|
-
// },
|
261
|
-
// ],
|
262
|
-
// },
|
263
|
-
// {
|
264
|
-
// name: 'Organization Admin',
|
265
|
-
// key: '3',
|
266
|
-
// organizations: [
|
267
|
-
// {
|
268
|
-
// name: 'Montana (Environment)',
|
269
|
-
// populations: [
|
270
|
-
// 'Administrators (Population)',
|
271
|
-
// 'Other Population (Population)',
|
272
|
-
// ],
|
273
|
-
// },
|
274
|
-
// {
|
275
|
-
// name: 'Boston (Environment)',
|
276
|
-
// populations: [
|
277
|
-
// ],
|
278
|
-
// },
|
279
|
-
// ],
|
280
|
-
// },
|
281
|
-
// ];
|
260
|
+
return (// See story source for info about the data used
|
282
261
|
(0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.Text, {
|
283
262
|
sx: {
|
284
263
|
fontWeight: 3,
|
@@ -291,7 +270,7 @@ var Default = function Default() {
|
|
291
270
|
}), (0, _react2.jsx)(_AccordionGridGroup["default"], {
|
292
271
|
items: data,
|
293
272
|
selectedKeys: selectedKeys,
|
294
|
-
onSelectionChange:
|
273
|
+
onSelectionChange: setSelectedKeys
|
295
274
|
}, function (item) {
|
296
275
|
return (0, _react2.jsx)(_collections.Item, {
|
297
276
|
key: item.key,
|
@@ -310,4 +289,4 @@ var Default = function Default() {
|
|
310
289
|
);
|
311
290
|
};
|
312
291
|
|
313
|
-
exports.
|
292
|
+
exports.Controlled = Controlled;
|
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
4
|
|
5
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
6
|
+
|
7
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
8
|
+
|
5
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
6
10
|
|
7
11
|
var _react = _interopRequireDefault(require("react"));
|
@@ -63,23 +67,6 @@ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
|
|
63
67
|
}
|
64
68
|
}
|
65
69
|
});
|
66
|
-
test('button press', function () {
|
67
|
-
var onPress = jest.fn();
|
68
|
-
getComponent({
|
69
|
-
onPress: onPress
|
70
|
-
});
|
71
|
-
|
72
|
-
var buttons = _testWrapper.screen.getAllByRole('gridcell');
|
73
|
-
|
74
|
-
var selectedItem = buttons[0];
|
75
|
-
expect(selectedItem).toBeInTheDocument();
|
76
|
-
expect(selectedItem).not.toHaveClass('is-pressed');
|
77
|
-
expect(onPress).not.toHaveBeenCalled(); // Hold down the button to see pressed styles
|
78
|
-
|
79
|
-
_testWrapper.fireEvent.mouseDown(selectedItem);
|
80
|
-
|
81
|
-
expect(selectedItem).toHaveClass('is-pressed');
|
82
|
-
});
|
83
70
|
test('button press uses callback', function () {
|
84
71
|
var onPress = jest.fn();
|
85
72
|
getComponent({
|
@@ -92,9 +79,7 @@ test('button press uses callback', function () {
|
|
92
79
|
expect(selectedItem).not.toHaveClass('is-pressed');
|
93
80
|
expect(onPress).not.toHaveBeenCalled(); // Hold down the button to see pressed styles
|
94
81
|
|
95
|
-
|
96
|
-
|
97
|
-
_testWrapper.fireEvent.mouseUp(selectedItem);
|
82
|
+
_userEvent["default"].click(selectedItem);
|
98
83
|
|
99
84
|
expect(onPress).toHaveBeenCalled();
|
100
85
|
});
|
@@ -237,16 +222,26 @@ test('disabled keys prop disables an accordion item, and disables focus', functi
|
|
237
222
|
expect(selectedRow).toHaveClass('is-disabled');
|
238
223
|
expect(selectedRow).not.toHaveClass('is-focused');
|
239
224
|
});
|
240
|
-
test('default expanded keys expands an accordion item', function () {
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
225
|
+
test('default expanded keys expands an accordion item', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
226
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
227
|
+
while (1) {
|
228
|
+
switch (_context.prev = _context.next) {
|
229
|
+
case 0:
|
230
|
+
getComponent({
|
231
|
+
selectedKeys: ['first']
|
232
|
+
});
|
233
|
+
_context.next = 3;
|
234
|
+
return (0, _testWrapper.waitFor)(function () {
|
235
|
+
return expect(_testWrapper.screen.getAllByRole('row')[0]).toHaveAttribute('aria-selected', 'true');
|
236
|
+
});
|
237
|
+
|
238
|
+
case 3:
|
239
|
+
case "end":
|
240
|
+
return _context.stop();
|
241
|
+
}
|
242
|
+
}
|
243
|
+
}, _callee);
|
244
|
+
})));
|
250
245
|
test('items do not automatically expand if wrapped in an open OverlayPanel', function () {
|
251
246
|
getComponentInOverlayPanel();
|
252
247
|
|