Commit 61cf086
[polaris.shopify.com] Add ability to collapse types in props table. (#7254)
### WHY are these changes introduced?
Hot on the heels of #6757 being
merged, this change introduces the ability to collapse props after being
expanded. This allows users to expand ("explore") and then collapse
("focus") props as needed depending on the types they want to see.
**Before**
https://user-images.githubusercontent.com/49090/191797340-233d321e-121e-4029-8ae2-7b4ddcb21f93.mp4
**After**
https://user-images.githubusercontent.com/49090/191797509-5674e76a-caf4-4615-97ef-4f483325a7c2.mp4
### WHAT is this pull request doing?
- Adds an additional function to collapse props within the props table.
- Wraps the `TypeTable` in `<AnimatePresence>` per [Framer's
instruction](https://www.framer.com/docs/animate-presence/##exit-animations)
when using exit animations on `div.motion` as well as a `key`.
- Updated `hasBenExpanded` to `hasBeenExpanded` -- think this was a
typo.
- I also introduced a subtle hover state on the clickable types, since
it wasn't immediately obvious to me that they were interactable.
### How to 🎩
🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)
Run the Polaris docs:
1. `dev up`
2. `cd polaris.shopify.com && yarn run dev`
3. Open up a component page - e.g.
http://localhost:3000/components/option-list
### 🎩 checklist
- 🚫 Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [x] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- 🚫 Updated the component's `README.md` with documentation changes
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
Co-authored-by: Marten Bjork <[email protected]>1 parent f714012 commit 61cf086
File tree
3 files changed
+85
-26
lines changed- .changeset
- polaris.shopify.com/src/components/PropsTable
3 files changed
+85
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
43 | 56 | | |
44 | 57 | | |
45 | 58 | | |
| |||
66 | 79 | | |
67 | 80 | | |
68 | 81 | | |
69 | | - | |
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
| |||
Lines changed: 67 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| 75 | + | |
73 | 76 | | |
74 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| 94 | + | |
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
| 98 | + | |
88 | 99 | | |
89 | 100 | | |
90 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
91 | 108 | | |
92 | 109 | | |
93 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
94 | 116 | | |
95 | 117 | | |
96 | 118 | | |
97 | 119 | | |
98 | 120 | | |
99 | 121 | | |
100 | | - | |
| 122 | + | |
101 | 123 | | |
102 | 124 | | |
103 | 125 | | |
104 | | - | |
105 | | - | |
| 126 | + | |
| 127 | + | |
106 | 128 | | |
107 | 129 | | |
108 | 130 | | |
109 | 131 | | |
110 | 132 | | |
111 | 133 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
125 | 149 | | |
126 | 150 | | |
127 | 151 | | |
| |||
137 | 161 | | |
138 | 162 | | |
139 | 163 | | |
140 | | - | |
| 164 | + | |
141 | 165 | | |
142 | 166 | | |
143 | 167 | | |
144 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
145 | 181 | | |
146 | 182 | | |
147 | 183 | | |
148 | 184 | | |
149 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
150 | 191 | | |
151 | 192 | | |
152 | 193 | | |
| |||
200 | 241 | | |
201 | 242 | | |
202 | 243 | | |
| 244 | + | |
203 | 245 | | |
204 | 246 | | |
205 | 247 | | |
| |||
226 | 268 | | |
227 | 269 | | |
228 | 270 | | |
229 | | - | |
| 271 | + | |
230 | 272 | | |
231 | 273 | | |
232 | 274 | | |
| |||
275 | 317 | | |
276 | 318 | | |
277 | 319 | | |
278 | | - | |
279 | | - | |
| 320 | + | |
| 321 | + | |
280 | 322 | | |
281 | 323 | | |
282 | 324 | | |
| |||
0 commit comments