@khanacademy/wonder-blocks-accordion 3.0.7 → 3.1.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 +192 -170
- package/LICENSE +21 -0
- package/dist/es/index.js +23 -48
- package/dist/index.js +39 -71
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,418 +1,440 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-accordion
|
|
2
2
|
|
|
3
|
+
## 3.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f03298f: Tooling:
|
|
8
|
+
|
|
9
|
+
- Switching to `pnpm`.
|
|
10
|
+
- Upgrading `rollup` to v4 and `@babel/runtime` to match the current webapp version.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 969864b: Update internal addStyle variable name to address aphrodite-add-style-variable-name linting rule
|
|
15
|
+
- bb2a026: pnpm: Switch to workspace protocol to handle dependency versions with changesets on monorepo setup"
|
|
16
|
+
- Updated dependencies [969864b]
|
|
17
|
+
- Updated dependencies [bb2a026]
|
|
18
|
+
- Updated dependencies [f03298f]
|
|
19
|
+
- @khanacademy/wonder-blocks-clickable@6.1.0
|
|
20
|
+
- @khanacademy/wonder-blocks-core@12.1.0
|
|
21
|
+
- @khanacademy/wonder-blocks-icon@5.1.0
|
|
22
|
+
- @khanacademy/wonder-blocks-typography@3.1.0
|
|
23
|
+
- @khanacademy/wonder-blocks-tokens@4.2.0
|
|
24
|
+
|
|
3
25
|
## 3.0.7
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
6
28
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
29
|
+
- Updated dependencies [0199324d]
|
|
30
|
+
- @khanacademy/wonder-blocks-clickable@6.0.0
|
|
31
|
+
- @khanacademy/wonder-blocks-core@12.0.0
|
|
32
|
+
- @khanacademy/wonder-blocks-icon@5.0.6
|
|
33
|
+
- @khanacademy/wonder-blocks-typography@3.0.6
|
|
12
34
|
|
|
13
35
|
## 3.0.6
|
|
14
36
|
|
|
15
37
|
### Patch Changes
|
|
16
38
|
|
|
17
|
-
-
|
|
39
|
+
- 7057fa7c: Replace `color` with `semanticColor` tokens
|
|
18
40
|
|
|
19
41
|
## 3.0.5
|
|
20
42
|
|
|
21
43
|
### Patch Changes
|
|
22
44
|
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
45
|
+
- Updated dependencies [8cfaeab0]
|
|
46
|
+
- Updated dependencies [c162abb4]
|
|
47
|
+
- @khanacademy/wonder-blocks-tokens@4.1.0
|
|
48
|
+
- @khanacademy/wonder-blocks-clickable@5.0.7
|
|
27
49
|
|
|
28
50
|
## 3.0.4
|
|
29
51
|
|
|
30
52
|
### Patch Changes
|
|
31
53
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
54
|
+
- Updated dependencies [0de25cd8]
|
|
55
|
+
- @khanacademy/wonder-blocks-tokens@4.0.0
|
|
56
|
+
- @khanacademy/wonder-blocks-clickable@5.0.6
|
|
35
57
|
|
|
36
58
|
## 3.0.3
|
|
37
59
|
|
|
38
60
|
### Patch Changes
|
|
39
61
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
62
|
+
- Updated dependencies [7516b239]
|
|
63
|
+
- @khanacademy/wonder-blocks-core@11.1.0
|
|
64
|
+
- @khanacademy/wonder-blocks-clickable@5.0.5
|
|
65
|
+
- @khanacademy/wonder-blocks-icon@5.0.5
|
|
66
|
+
- @khanacademy/wonder-blocks-typography@3.0.5
|
|
45
67
|
|
|
46
68
|
## 3.0.2
|
|
47
69
|
|
|
48
70
|
### Patch Changes
|
|
49
71
|
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
72
|
+
- 11a0f5c6: No functional changes. Adding prepublishOnly script.
|
|
73
|
+
- Updated dependencies [11a0f5c6]
|
|
74
|
+
- @khanacademy/wonder-blocks-typography@3.0.4
|
|
75
|
+
- @khanacademy/wonder-blocks-clickable@5.0.4
|
|
76
|
+
- @khanacademy/wonder-blocks-tokens@3.0.1
|
|
77
|
+
- @khanacademy/wonder-blocks-core@11.0.1
|
|
78
|
+
- @khanacademy/wonder-blocks-icon@5.0.4
|
|
57
79
|
|
|
58
80
|
## 3.0.1
|
|
59
81
|
|
|
60
82
|
### Patch Changes
|
|
61
83
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
84
|
+
- Updated dependencies [d23c9c5f]
|
|
85
|
+
- @khanacademy/wonder-blocks-core@11.0.0
|
|
86
|
+
- @khanacademy/wonder-blocks-clickable@5.0.3
|
|
87
|
+
- @khanacademy/wonder-blocks-icon@5.0.3
|
|
88
|
+
- @khanacademy/wonder-blocks-typography@3.0.3
|
|
67
89
|
|
|
68
90
|
## 3.0.0
|
|
69
91
|
|
|
70
92
|
### Major Changes
|
|
71
93
|
|
|
72
|
-
-
|
|
94
|
+
- 56d961f1: - Migrate Wonder Blocks components off old id providers and onto new `Id` component
|
|
73
95
|
|
|
74
96
|
### Patch Changes
|
|
75
97
|
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
98
|
+
- b6009b77: Deprecate the ID provider and unique ID utilities
|
|
99
|
+
- Updated dependencies [b6009b77]
|
|
100
|
+
- Updated dependencies [897686bc]
|
|
101
|
+
- Updated dependencies [56d961f1]
|
|
102
|
+
- @khanacademy/wonder-blocks-core@10.0.0
|
|
103
|
+
- @khanacademy/wonder-blocks-clickable@5.0.2
|
|
104
|
+
- @khanacademy/wonder-blocks-icon@5.0.2
|
|
105
|
+
- @khanacademy/wonder-blocks-typography@3.0.2
|
|
84
106
|
|
|
85
107
|
## 2.0.1
|
|
86
108
|
|
|
87
109
|
### Patch Changes
|
|
88
110
|
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
111
|
+
- Updated dependencies [f4abd572]
|
|
112
|
+
- @khanacademy/wonder-blocks-core@9.0.0
|
|
113
|
+
- @khanacademy/wonder-blocks-clickable@5.0.1
|
|
114
|
+
- @khanacademy/wonder-blocks-icon@5.0.1
|
|
115
|
+
- @khanacademy/wonder-blocks-typography@3.0.1
|
|
94
116
|
|
|
95
117
|
## 2.0.0
|
|
96
118
|
|
|
97
119
|
### Major Changes
|
|
98
120
|
|
|
99
|
-
-
|
|
121
|
+
- e6abdd17: Upgrade to React 18
|
|
100
122
|
|
|
101
123
|
### Patch Changes
|
|
102
124
|
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
125
|
+
- Updated dependencies [e6abdd17]
|
|
126
|
+
- @khanacademy/wonder-blocks-core@8.0.0
|
|
127
|
+
- @khanacademy/wonder-blocks-clickable@5.0.0
|
|
128
|
+
- @khanacademy/wonder-blocks-icon@5.0.0
|
|
129
|
+
- @khanacademy/wonder-blocks-tokens@3.0.0
|
|
130
|
+
- @khanacademy/wonder-blocks-typography@3.0.0
|
|
109
131
|
|
|
110
132
|
## 1.3.10
|
|
111
133
|
|
|
112
134
|
### Patch Changes
|
|
113
135
|
|
|
114
|
-
-
|
|
115
|
-
-
|
|
136
|
+
- Updated dependencies [c1110599]
|
|
137
|
+
- @khanacademy/wonder-blocks-icon@4.2.0
|
|
116
138
|
|
|
117
139
|
## 1.3.9
|
|
118
140
|
|
|
119
141
|
### Patch Changes
|
|
120
142
|
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
143
|
+
- Updated dependencies [6999fd39]
|
|
144
|
+
- @khanacademy/wonder-blocks-tokens@2.1.0
|
|
145
|
+
- @khanacademy/wonder-blocks-clickable@4.2.9
|
|
124
146
|
|
|
125
147
|
## 1.3.8
|
|
126
148
|
|
|
127
149
|
### Patch Changes
|
|
128
150
|
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
151
|
+
- 02a1b298: Make sure we don't package tsconfig and tsbuildinfo files
|
|
152
|
+
- Updated dependencies [02a1b298]
|
|
153
|
+
- @khanacademy/wonder-blocks-clickable@4.2.8
|
|
154
|
+
- @khanacademy/wonder-blocks-core@7.0.1
|
|
155
|
+
- @khanacademy/wonder-blocks-icon@4.1.5
|
|
156
|
+
- @khanacademy/wonder-blocks-tokens@2.0.1
|
|
157
|
+
- @khanacademy/wonder-blocks-typography@2.1.16
|
|
136
158
|
|
|
137
159
|
## 1.3.7
|
|
138
160
|
|
|
139
161
|
### Patch Changes
|
|
140
162
|
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
163
|
+
- Updated dependencies [07f7f407]
|
|
164
|
+
- @khanacademy/wonder-blocks-core@7.0.0
|
|
165
|
+
- @khanacademy/wonder-blocks-clickable@4.2.7
|
|
166
|
+
- @khanacademy/wonder-blocks-icon@4.1.4
|
|
167
|
+
- @khanacademy/wonder-blocks-typography@2.1.15
|
|
146
168
|
|
|
147
169
|
## 1.3.6
|
|
148
170
|
|
|
149
171
|
### Patch Changes
|
|
150
172
|
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
173
|
+
- Updated dependencies [f17dc1ee]
|
|
174
|
+
- Updated dependencies [991eb43f]
|
|
175
|
+
- @khanacademy/wonder-blocks-tokens@2.0.0
|
|
176
|
+
- @khanacademy/wonder-blocks-clickable@4.2.6
|
|
155
177
|
|
|
156
178
|
## 1.3.5
|
|
157
179
|
|
|
158
180
|
### Patch Changes
|
|
159
181
|
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
182
|
+
- 559e82d5: Update to build tooling, generating smaller output
|
|
183
|
+
- Updated dependencies [559e82d5]
|
|
184
|
+
- @khanacademy/wonder-blocks-clickable@4.2.5
|
|
185
|
+
- @khanacademy/wonder-blocks-core@6.4.3
|
|
186
|
+
- @khanacademy/wonder-blocks-icon@4.1.3
|
|
187
|
+
- @khanacademy/wonder-blocks-tokens@1.3.1
|
|
188
|
+
- @khanacademy/wonder-blocks-typography@2.1.14
|
|
167
189
|
|
|
168
190
|
## 1.3.4
|
|
169
191
|
|
|
170
192
|
### Patch Changes
|
|
171
193
|
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
194
|
+
- Updated dependencies [eab37b8b]
|
|
195
|
+
- @khanacademy/wonder-blocks-core@6.4.2
|
|
196
|
+
- @khanacademy/wonder-blocks-clickable@4.2.4
|
|
197
|
+
- @khanacademy/wonder-blocks-icon@4.1.2
|
|
198
|
+
- @khanacademy/wonder-blocks-typography@2.1.13
|
|
177
199
|
|
|
178
200
|
## 1.3.3
|
|
179
201
|
|
|
180
202
|
### Patch Changes
|
|
181
203
|
|
|
182
|
-
-
|
|
183
|
-
-
|
|
204
|
+
- Updated dependencies [f099cf87]
|
|
205
|
+
- @khanacademy/wonder-blocks-clickable@4.2.3
|
|
184
206
|
|
|
185
207
|
## 1.3.2
|
|
186
208
|
|
|
187
209
|
### Patch Changes
|
|
188
210
|
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
211
|
+
- Updated dependencies [5dfac06e]
|
|
212
|
+
- @khanacademy/wonder-blocks-core@6.4.1
|
|
213
|
+
- @khanacademy/wonder-blocks-clickable@4.2.2
|
|
214
|
+
- @khanacademy/wonder-blocks-icon@4.1.1
|
|
215
|
+
- @khanacademy/wonder-blocks-typography@2.1.12
|
|
194
216
|
|
|
195
217
|
## 1.3.1
|
|
196
218
|
|
|
197
219
|
### Patch Changes
|
|
198
220
|
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
221
|
+
- Updated dependencies [9bfeead9]
|
|
222
|
+
- @khanacademy/wonder-blocks-tokens@1.3.0
|
|
223
|
+
- @khanacademy/wonder-blocks-clickable@4.2.1
|
|
202
224
|
|
|
203
225
|
## 1.3.0
|
|
204
226
|
|
|
205
227
|
### Minor Changes
|
|
206
228
|
|
|
207
|
-
-
|
|
229
|
+
- 58075352: Change testId to render the default Testing Library HTML attribute: data-testid (was data-test-id)
|
|
208
230
|
|
|
209
231
|
### Patch Changes
|
|
210
232
|
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
215
|
-
-
|
|
233
|
+
- Updated dependencies [58075352]
|
|
234
|
+
- @khanacademy/wonder-blocks-clickable@4.2.0
|
|
235
|
+
- @khanacademy/wonder-blocks-core@6.4.0
|
|
236
|
+
- @khanacademy/wonder-blocks-icon@4.1.0
|
|
237
|
+
- @khanacademy/wonder-blocks-typography@2.1.11
|
|
216
238
|
|
|
217
239
|
## 1.2.16
|
|
218
240
|
|
|
219
241
|
### Patch Changes
|
|
220
242
|
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
-
|
|
243
|
+
- Updated dependencies [874081aa]
|
|
244
|
+
- Updated dependencies [874081aa]
|
|
245
|
+
- Updated dependencies [a9bf603a]
|
|
246
|
+
- @khanacademy/wonder-blocks-tokens@1.2.0
|
|
247
|
+
- @khanacademy/wonder-blocks-clickable@4.1.3
|
|
226
248
|
|
|
227
249
|
## 1.2.15
|
|
228
250
|
|
|
229
251
|
### Patch Changes
|
|
230
252
|
|
|
231
|
-
-
|
|
232
|
-
-
|
|
253
|
+
- Updated dependencies [e6433bee]
|
|
254
|
+
- @khanacademy/wonder-blocks-clickable@4.1.2
|
|
233
255
|
|
|
234
256
|
## 1.2.14
|
|
235
257
|
|
|
236
258
|
### Patch Changes
|
|
237
259
|
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
260
|
+
- Updated dependencies [4cfb4977]
|
|
261
|
+
- @khanacademy/wonder-blocks-tokens@1.1.0
|
|
262
|
+
- @khanacademy/wonder-blocks-clickable@4.1.1
|
|
241
263
|
|
|
242
264
|
## 1.2.13
|
|
243
265
|
|
|
244
266
|
### Patch Changes
|
|
245
267
|
|
|
246
|
-
-
|
|
247
|
-
-
|
|
268
|
+
- Updated dependencies [60fdac1c]
|
|
269
|
+
- @khanacademy/wonder-blocks-clickable@4.1.0
|
|
248
270
|
|
|
249
271
|
## 1.2.12
|
|
250
272
|
|
|
251
273
|
### Patch Changes
|
|
252
274
|
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
-
|
|
275
|
+
- Updated dependencies [e83f8991]
|
|
276
|
+
- @khanacademy/wonder-blocks-tokens@1.0.0
|
|
277
|
+
- @khanacademy/wonder-blocks-clickable@4.0.14
|
|
256
278
|
|
|
257
279
|
## 1.2.11
|
|
258
280
|
|
|
259
281
|
### Patch Changes
|
|
260
282
|
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
283
|
+
- 7cd7f6cc: Replace theming.tokens with wb-tokens and update callsites to use the new export
|
|
284
|
+
- Updated dependencies [7cd7f6cc]
|
|
285
|
+
- Updated dependencies [7c51f377]
|
|
286
|
+
- Updated dependencies [7c51f377]
|
|
287
|
+
- @khanacademy/wonder-blocks-tokens@0.2.0
|
|
288
|
+
- @khanacademy/wonder-blocks-clickable@4.0.13
|
|
267
289
|
|
|
268
290
|
## 1.2.10
|
|
269
291
|
|
|
270
292
|
### Patch Changes
|
|
271
293
|
|
|
272
|
-
-
|
|
294
|
+
- fafa8a69: Prevent default in home, end, and arrow keys
|
|
273
295
|
|
|
274
296
|
## 1.2.9
|
|
275
297
|
|
|
276
298
|
### Patch Changes
|
|
277
299
|
|
|
278
|
-
-
|
|
279
|
-
-
|
|
300
|
+
- Updated dependencies [80592e75]
|
|
301
|
+
- @khanacademy/wonder-blocks-theming@1.3.0
|
|
280
302
|
|
|
281
303
|
## 1.2.8
|
|
282
304
|
|
|
283
305
|
### Patch Changes
|
|
284
306
|
|
|
285
|
-
-
|
|
307
|
+
- 5cf814ce: Fix focus handling for Accordion headers
|
|
286
308
|
|
|
287
309
|
## 1.2.7
|
|
288
310
|
|
|
289
311
|
### Patch Changes
|
|
290
312
|
|
|
291
|
-
-
|
|
313
|
+
- d0d567a5: Use minWidth: 0 in the header to prevent overflow issues
|
|
292
314
|
|
|
293
315
|
## 1.2.6
|
|
294
316
|
|
|
295
317
|
### Patch Changes
|
|
296
318
|
|
|
297
|
-
-
|
|
319
|
+
- 48e939d0: Use z-index to put the header outline in front of the content panel instead of adding a 2px margin that can cause weird spacing issues
|
|
298
320
|
|
|
299
321
|
## 1.2.5
|
|
300
322
|
|
|
301
323
|
### Patch Changes
|
|
302
324
|
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
325
|
+
- Updated dependencies [23ab9f8c]
|
|
326
|
+
- Updated dependencies [6df21f71]
|
|
327
|
+
- @khanacademy/wonder-blocks-icon@4.0.1
|
|
328
|
+
- @khanacademy/wonder-blocks-core@6.3.1
|
|
329
|
+
- @khanacademy/wonder-blocks-clickable@4.0.12
|
|
330
|
+
- @khanacademy/wonder-blocks-typography@2.1.10
|
|
309
331
|
|
|
310
332
|
## 1.2.4
|
|
311
333
|
|
|
312
334
|
### Patch Changes
|
|
313
335
|
|
|
314
|
-
-
|
|
336
|
+
- 138d25c5: Give AccordionSection static position to fix outline overlap issue
|
|
315
337
|
|
|
316
338
|
## 1.2.3
|
|
317
339
|
|
|
318
340
|
### Patch Changes
|
|
319
341
|
|
|
320
|
-
-
|
|
321
|
-
-
|
|
342
|
+
- Updated dependencies [171e3b01]
|
|
343
|
+
- @khanacademy/wonder-blocks-icon@4.0.0
|
|
322
344
|
|
|
323
345
|
## 1.2.2
|
|
324
346
|
|
|
325
347
|
### Patch Changes
|
|
326
348
|
|
|
327
|
-
-
|
|
328
|
-
-
|
|
349
|
+
- Updated dependencies [96f675d2]
|
|
350
|
+
- @khanacademy/wonder-blocks-icon@3.0.0
|
|
329
351
|
|
|
330
352
|
## 1.2.1
|
|
331
353
|
|
|
332
354
|
### Patch Changes
|
|
333
355
|
|
|
334
|
-
-
|
|
335
|
-
-
|
|
356
|
+
- Updated dependencies [edcfbe14]
|
|
357
|
+
- @khanacademy/wonder-blocks-theming@1.2.1
|
|
336
358
|
|
|
337
359
|
## 1.2.0
|
|
338
360
|
|
|
339
361
|
### Minor Changes
|
|
340
362
|
|
|
341
|
-
-
|
|
363
|
+
- b13d4321: Cleanup: prioritize all children overloaded props, fix typos, update documentation, make the accordion component public
|
|
342
364
|
|
|
343
365
|
## 1.1.2
|
|
344
366
|
|
|
345
367
|
### Patch Changes
|
|
346
368
|
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
369
|
+
- 16d99bde: Add region and aria-labelledby to accordion
|
|
370
|
+
- Updated dependencies [6b8bf8d5]
|
|
371
|
+
- @khanacademy/wonder-blocks-clickable@4.0.11
|
|
350
372
|
|
|
351
373
|
## 1.1.1
|
|
352
374
|
|
|
353
375
|
### Patch Changes
|
|
354
376
|
|
|
355
|
-
-
|
|
356
|
-
-
|
|
357
|
-
-
|
|
377
|
+
- 7b24db93: Add support for up arrow, down arrow, home, and end keys
|
|
378
|
+
- Updated dependencies [7b24db93]
|
|
379
|
+
- @khanacademy/wonder-blocks-clickable@4.0.10
|
|
358
380
|
|
|
359
381
|
## 1.1.0
|
|
360
382
|
|
|
361
383
|
### Minor Changes
|
|
362
384
|
|
|
363
|
-
-
|
|
364
|
-
-
|
|
385
|
+
- 2f0b77f2: Add animations to Accordion
|
|
386
|
+
- 1424a2c3: Add `collapsible` prop to AccordionSection
|
|
365
387
|
|
|
366
388
|
## 1.0.1
|
|
367
389
|
|
|
368
390
|
### Patch Changes
|
|
369
391
|
|
|
370
|
-
-
|
|
371
|
-
-
|
|
392
|
+
- Updated dependencies [3f854fe8]
|
|
393
|
+
- @khanacademy/wonder-blocks-theming@1.2.0
|
|
372
394
|
|
|
373
395
|
## 1.0.0
|
|
374
396
|
|
|
375
397
|
### Major Changes
|
|
376
398
|
|
|
377
|
-
-
|
|
399
|
+
- ff34408e: Create Accordion and AccordionSection components
|
|
378
400
|
|
|
379
401
|
### Patch Changes
|
|
380
402
|
|
|
381
|
-
-
|
|
382
|
-
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
385
|
-
-
|
|
403
|
+
- Updated dependencies [7055ca94]
|
|
404
|
+
- @khanacademy/wonder-blocks-core@6.3.0
|
|
405
|
+
- @khanacademy/wonder-blocks-clickable@4.0.9
|
|
406
|
+
- @khanacademy/wonder-blocks-icon@2.2.1
|
|
407
|
+
- @khanacademy/wonder-blocks-typography@2.1.9
|
|
386
408
|
|
|
387
409
|
## 0.0.5
|
|
388
410
|
|
|
389
411
|
### Patch Changes
|
|
390
412
|
|
|
391
|
-
-
|
|
392
|
-
-
|
|
413
|
+
- Updated dependencies [ea0e7c02]
|
|
414
|
+
- @khanacademy/wonder-blocks-icon@2.2.0
|
|
393
415
|
|
|
394
416
|
## 0.0.4
|
|
395
417
|
|
|
396
418
|
### Patch Changes
|
|
397
419
|
|
|
398
|
-
-
|
|
399
|
-
-
|
|
400
|
-
-
|
|
420
|
+
- Updated dependencies [48d3c7e9]
|
|
421
|
+
- @khanacademy/wonder-blocks-color@3.0.0
|
|
422
|
+
- @khanacademy/wonder-blocks-clickable@4.0.8
|
|
401
423
|
|
|
402
424
|
## 0.0.3
|
|
403
425
|
|
|
404
426
|
### Patch Changes
|
|
405
427
|
|
|
406
|
-
-
|
|
407
|
-
-
|
|
428
|
+
- Updated dependencies [80cab317]
|
|
429
|
+
- @khanacademy/wonder-blocks-clickable@4.0.7
|
|
408
430
|
|
|
409
431
|
## 0.0.2
|
|
410
432
|
|
|
411
433
|
### Patch Changes
|
|
412
434
|
|
|
413
|
-
-
|
|
414
|
-
-
|
|
415
|
-
-
|
|
416
|
-
-
|
|
417
|
-
-
|
|
418
|
-
-
|
|
435
|
+
- cde5377f: Create `wonder-blocks-accordion` package
|
|
436
|
+
- Updated dependencies [4b97b9a2]
|
|
437
|
+
- @khanacademy/wonder-blocks-core@6.2.0
|
|
438
|
+
- @khanacademy/wonder-blocks-clickable@4.0.6
|
|
439
|
+
- @khanacademy/wonder-blocks-icon@2.1.6
|
|
440
|
+
- @khanacademy/wonder-blocks-typography@2.1.8
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Khan Academy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/es/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
2
|
+
import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { useId } from 'react';
|
|
3
5
|
import { StyleSheet } from 'aphrodite';
|
|
@@ -8,36 +10,8 @@ import caretDown from '@phosphor-icons/core/bold/caret-down-bold.svg';
|
|
|
8
10
|
import Clickable from '@khanacademy/wonder-blocks-clickable';
|
|
9
11
|
import { PhosphorIcon } from '@khanacademy/wonder-blocks-icon';
|
|
10
12
|
|
|
11
|
-
function _extends() {
|
|
12
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
13
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
14
|
-
var source = arguments[i];
|
|
15
|
-
for (var key in source) {
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
17
|
-
target[key] = source[key];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return target;
|
|
22
|
-
};
|
|
23
|
-
return _extends.apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
27
|
-
if (source == null) return {};
|
|
28
|
-
var target = {};
|
|
29
|
-
var sourceKeys = Object.keys(source);
|
|
30
|
-
var key, i;
|
|
31
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
32
|
-
key = sourceKeys[i];
|
|
33
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
34
|
-
target[key] = source[key];
|
|
35
|
-
}
|
|
36
|
-
return target;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
13
|
const _excluded$1 = ["children", "id", "initialExpandedIndex", "allowMultipleExpanded", "caretPosition", "cornerKind", "animated", "style"];
|
|
40
|
-
const
|
|
14
|
+
const StyledUl = addStyle("ul");
|
|
41
15
|
const LANDMARK_PROLIFERATION_THRESHOLD = 6;
|
|
42
16
|
const Accordion = React.forwardRef(function Accordion(props, ref) {
|
|
43
17
|
const {
|
|
@@ -78,27 +52,27 @@ const Accordion = React.forwardRef(function Accordion(props, ref) {
|
|
|
78
52
|
event.preventDefault();
|
|
79
53
|
const previousSectionIndex = (currentlyFocusedHeaderIndex + children.length - 1) % children.length;
|
|
80
54
|
const previousChildRef = childRefs[previousSectionIndex];
|
|
81
|
-
(_previousChildRef$cur = previousChildRef.current) == null
|
|
55
|
+
(_previousChildRef$cur = previousChildRef.current) == null || _previousChildRef$cur.focus();
|
|
82
56
|
break;
|
|
83
57
|
case "ArrowDown":
|
|
84
58
|
event.preventDefault();
|
|
85
59
|
const nextSectionIndex = (currentlyFocusedHeaderIndex + 1) % children.length;
|
|
86
60
|
const nextChildRef = childRefs[nextSectionIndex];
|
|
87
|
-
(_nextChildRef$current = nextChildRef.current) == null
|
|
61
|
+
(_nextChildRef$current = nextChildRef.current) == null || _nextChildRef$current.focus();
|
|
88
62
|
break;
|
|
89
63
|
case "Home":
|
|
90
64
|
event.preventDefault();
|
|
91
65
|
const firstChildRef = childRefs[0];
|
|
92
|
-
(_firstChildRef$curren = firstChildRef.current) == null
|
|
66
|
+
(_firstChildRef$curren = firstChildRef.current) == null || _firstChildRef$curren.focus();
|
|
93
67
|
break;
|
|
94
68
|
case "End":
|
|
95
69
|
event.preventDefault();
|
|
96
70
|
const lastChildRef = childRefs[children.length - 1];
|
|
97
|
-
(_lastChildRef$current = lastChildRef.current) == null
|
|
71
|
+
(_lastChildRef$current = lastChildRef.current) == null || _lastChildRef$current.focus();
|
|
98
72
|
break;
|
|
99
73
|
}
|
|
100
74
|
};
|
|
101
|
-
return React.createElement(
|
|
75
|
+
return React.createElement(StyledUl, _extends({
|
|
102
76
|
style: [styles$2.wrapper, style],
|
|
103
77
|
onKeyDown: handleKeyDown
|
|
104
78
|
}, ariaProps, {
|
|
@@ -114,20 +88,21 @@ const Accordion = React.forwardRef(function Accordion(props, ref) {
|
|
|
114
88
|
childRefs[index] = childRef;
|
|
115
89
|
const isFirstChild = index === 0;
|
|
116
90
|
const isLastChild = index === children.length - 1;
|
|
117
|
-
return React.createElement("li", {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
91
|
+
return (React.createElement("li", {
|
|
92
|
+
key: index,
|
|
93
|
+
id: id
|
|
94
|
+
}, React.cloneElement(child, {
|
|
95
|
+
animated: childAnimated != null ? childAnimated : animated,
|
|
96
|
+
caretPosition: childCaretPosition != null ? childCaretPosition : caretPosition,
|
|
97
|
+
cornerKind: childCornerKind != null ? childCornerKind : cornerKind,
|
|
98
|
+
expanded: sectionsOpened[index],
|
|
99
|
+
onToggle: () => handleSectionClick(index, childOnToggle),
|
|
100
|
+
isFirstSection: isFirstChild,
|
|
101
|
+
isLastSection: isLastChild,
|
|
102
|
+
isRegion: sectionsAreRegions,
|
|
103
|
+
ref: childRef
|
|
104
|
+
}))
|
|
105
|
+
);
|
|
131
106
|
}));
|
|
132
107
|
});
|
|
133
108
|
const styles$2 = StyleSheet.create({
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
4
|
+
var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var aphrodite = require('aphrodite');
|
|
7
7
|
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
@@ -11,60 +11,27 @@ var caretDown = require('@phosphor-icons/core/bold/caret-down-bold.svg');
|
|
|
11
11
|
var Clickable = require('@khanacademy/wonder-blocks-clickable');
|
|
12
12
|
var wonderBlocksIcon = require('@khanacademy/wonder-blocks-icon');
|
|
13
13
|
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
get: function () { return e[k]; }
|
|
14
|
+
function _interopNamespaceDefault(e) {
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
26
25
|
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
n["default"] = e;
|
|
31
|
-
return Object.freeze(n);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
35
|
-
var caretDown__default = /*#__PURE__*/_interopDefaultLegacy(caretDown);
|
|
36
|
-
var Clickable__default = /*#__PURE__*/_interopDefaultLegacy(Clickable);
|
|
37
|
-
|
|
38
|
-
function _extends() {
|
|
39
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
40
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
41
|
-
var source = arguments[i];
|
|
42
|
-
for (var key in source) {
|
|
43
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
44
|
-
target[key] = source[key];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
26
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return _extends.apply(this, arguments);
|
|
27
|
+
n.default = e;
|
|
28
|
+
return Object.freeze(n);
|
|
51
29
|
}
|
|
52
30
|
|
|
53
|
-
|
|
54
|
-
if (source == null) return {};
|
|
55
|
-
var target = {};
|
|
56
|
-
var sourceKeys = Object.keys(source);
|
|
57
|
-
var key, i;
|
|
58
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
59
|
-
key = sourceKeys[i];
|
|
60
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
-
target[key] = source[key];
|
|
62
|
-
}
|
|
63
|
-
return target;
|
|
64
|
-
}
|
|
31
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
65
32
|
|
|
66
33
|
const _excluded$1 = ["children", "id", "initialExpandedIndex", "allowMultipleExpanded", "caretPosition", "cornerKind", "animated", "style"];
|
|
67
|
-
const
|
|
34
|
+
const StyledUl = wonderBlocksCore.addStyle("ul");
|
|
68
35
|
const LANDMARK_PROLIFERATION_THRESHOLD = 6;
|
|
69
36
|
const Accordion = React__namespace.forwardRef(function Accordion(props, ref) {
|
|
70
37
|
const {
|
|
@@ -105,27 +72,27 @@ const Accordion = React__namespace.forwardRef(function Accordion(props, ref) {
|
|
|
105
72
|
event.preventDefault();
|
|
106
73
|
const previousSectionIndex = (currentlyFocusedHeaderIndex + children.length - 1) % children.length;
|
|
107
74
|
const previousChildRef = childRefs[previousSectionIndex];
|
|
108
|
-
(_previousChildRef$cur = previousChildRef.current) == null
|
|
75
|
+
(_previousChildRef$cur = previousChildRef.current) == null || _previousChildRef$cur.focus();
|
|
109
76
|
break;
|
|
110
77
|
case "ArrowDown":
|
|
111
78
|
event.preventDefault();
|
|
112
79
|
const nextSectionIndex = (currentlyFocusedHeaderIndex + 1) % children.length;
|
|
113
80
|
const nextChildRef = childRefs[nextSectionIndex];
|
|
114
|
-
(_nextChildRef$current = nextChildRef.current) == null
|
|
81
|
+
(_nextChildRef$current = nextChildRef.current) == null || _nextChildRef$current.focus();
|
|
115
82
|
break;
|
|
116
83
|
case "Home":
|
|
117
84
|
event.preventDefault();
|
|
118
85
|
const firstChildRef = childRefs[0];
|
|
119
|
-
(_firstChildRef$curren = firstChildRef.current) == null
|
|
86
|
+
(_firstChildRef$curren = firstChildRef.current) == null || _firstChildRef$curren.focus();
|
|
120
87
|
break;
|
|
121
88
|
case "End":
|
|
122
89
|
event.preventDefault();
|
|
123
90
|
const lastChildRef = childRefs[children.length - 1];
|
|
124
|
-
(_lastChildRef$current = lastChildRef.current) == null
|
|
91
|
+
(_lastChildRef$current = lastChildRef.current) == null || _lastChildRef$current.focus();
|
|
125
92
|
break;
|
|
126
93
|
}
|
|
127
94
|
};
|
|
128
|
-
return React__namespace.createElement(
|
|
95
|
+
return React__namespace.createElement(StyledUl, _extends({
|
|
129
96
|
style: [styles$2.wrapper, style],
|
|
130
97
|
onKeyDown: handleKeyDown
|
|
131
98
|
}, ariaProps, {
|
|
@@ -141,20 +108,21 @@ const Accordion = React__namespace.forwardRef(function Accordion(props, ref) {
|
|
|
141
108
|
childRefs[index] = childRef;
|
|
142
109
|
const isFirstChild = index === 0;
|
|
143
110
|
const isLastChild = index === children.length - 1;
|
|
144
|
-
return React__namespace.createElement("li", {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
111
|
+
return (React__namespace.createElement("li", {
|
|
112
|
+
key: index,
|
|
113
|
+
id: id
|
|
114
|
+
}, React__namespace.cloneElement(child, {
|
|
115
|
+
animated: childAnimated != null ? childAnimated : animated,
|
|
116
|
+
caretPosition: childCaretPosition != null ? childCaretPosition : caretPosition,
|
|
117
|
+
cornerKind: childCornerKind != null ? childCornerKind : cornerKind,
|
|
118
|
+
expanded: sectionsOpened[index],
|
|
119
|
+
onToggle: () => handleSectionClick(index, childOnToggle),
|
|
120
|
+
isFirstSection: isFirstChild,
|
|
121
|
+
isLastSection: isLastChild,
|
|
122
|
+
isRegion: sectionsAreRegions,
|
|
123
|
+
ref: childRef
|
|
124
|
+
}))
|
|
125
|
+
);
|
|
158
126
|
}));
|
|
159
127
|
});
|
|
160
128
|
const styles$2 = aphrodite.StyleSheet.create({
|
|
@@ -211,7 +179,7 @@ const AccordionSectionHeader = React__namespace.forwardRef(function AccordionSec
|
|
|
211
179
|
return React__namespace.createElement(wonderBlocksTypography.HeadingSmall, {
|
|
212
180
|
tag: tag,
|
|
213
181
|
style: styles$1.heading
|
|
214
|
-
}, React__namespace.createElement(
|
|
182
|
+
}, React__namespace.createElement(Clickable, {
|
|
215
183
|
id: id,
|
|
216
184
|
"aria-expanded": expanded,
|
|
217
185
|
"aria-controls": sectionContentUniqueId,
|
|
@@ -225,7 +193,7 @@ const AccordionSectionHeader = React__namespace.forwardRef(function AccordionSec
|
|
|
225
193
|
}, headerIsString ? React__namespace.createElement(wonderBlocksCore.View, {
|
|
226
194
|
style: [caretPosition === "end" ? styles$1.headerStringCaretEnd : styles$1.headerStringCaretStart]
|
|
227
195
|
}, header) : header), collapsible && React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
228
|
-
icon:
|
|
196
|
+
icon: caretDown,
|
|
229
197
|
color: wonderBlocksTokens.semanticColor.icon.primary,
|
|
230
198
|
size: "small",
|
|
231
199
|
style: [animated && styles$1.iconWithAnimation, caretPosition === "start" ? styles$1.iconStart : styles$1.iconEnd, expanded && styles$1.iconExpanded],
|
package/package.json
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-accordion",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "Accordion components for Wonder Blocks.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/es/index.js",
|
|
8
8
|
"source": "src/index.js",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
-
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
|
|
12
|
-
},
|
|
13
9
|
"types": "dist/index.d.ts",
|
|
14
10
|
"author": "",
|
|
15
11
|
"license": "MIT",
|
|
@@ -17,11 +13,12 @@
|
|
|
17
13
|
"access": "public"
|
|
18
14
|
},
|
|
19
15
|
"dependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@khanacademy/wonder-blocks-
|
|
22
|
-
"@khanacademy/wonder-blocks-
|
|
23
|
-
"@khanacademy/wonder-blocks-
|
|
24
|
-
"@khanacademy/wonder-blocks-
|
|
16
|
+
"@babel/runtime": "^7.24.5",
|
|
17
|
+
"@khanacademy/wonder-blocks-clickable": "6.1.0",
|
|
18
|
+
"@khanacademy/wonder-blocks-core": "12.1.0",
|
|
19
|
+
"@khanacademy/wonder-blocks-icon": "5.1.0",
|
|
20
|
+
"@khanacademy/wonder-blocks-tokens": "4.2.0",
|
|
21
|
+
"@khanacademy/wonder-blocks-typography": "3.1.0"
|
|
25
22
|
},
|
|
26
23
|
"peerDependencies": {
|
|
27
24
|
"@phosphor-icons/core": "^2.0.2",
|
|
@@ -29,6 +26,9 @@
|
|
|
29
26
|
"react": "18.2.0"
|
|
30
27
|
},
|
|
31
28
|
"devDependencies": {
|
|
32
|
-
"@khanacademy/wb-dev-build-settings": "
|
|
29
|
+
"@khanacademy/wb-dev-build-settings": "2.1.0"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
33
33
|
}
|
|
34
34
|
}
|