@khanacademy/wonder-blocks-labeled-field 2.0.2 → 2.1.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 +171 -140
- package/LICENSE +21 -0
- package/dist/es/index.js +1 -63
- package/dist/index.js +16 -80
- package/package.json +10 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,318 +1,349 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-labeled-field
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ee8d95a: Rollback rollup version from v4 to v2 to prevent an issue with CJS builds in unit tests
|
|
8
|
+
- Updated dependencies [ee8d95a]
|
|
9
|
+
- @khanacademy/wonder-blocks-core@12.1.1
|
|
10
|
+
- @khanacademy/wonder-blocks-layout@3.1.1
|
|
11
|
+
- @khanacademy/wonder-blocks-tokens@4.2.1
|
|
12
|
+
- @khanacademy/wonder-blocks-typography@3.1.1
|
|
13
|
+
|
|
14
|
+
## 2.1.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- f03298f: Tooling:
|
|
19
|
+
|
|
20
|
+
- Switching to `pnpm`.
|
|
21
|
+
- Upgrading `rollup` to v4 and `@babel/runtime` to match the current webapp version.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- bb2a026: pnpm: Switch to workspace protocol to handle dependency versions with changesets on monorepo setup"
|
|
26
|
+
- Updated dependencies [969864b]
|
|
27
|
+
- Updated dependencies [bb2a026]
|
|
28
|
+
- Updated dependencies [f03298f]
|
|
29
|
+
- @khanacademy/wonder-blocks-core@12.1.0
|
|
30
|
+
- @khanacademy/wonder-blocks-typography@3.1.0
|
|
31
|
+
- @khanacademy/wonder-blocks-layout@3.1.0
|
|
32
|
+
- @khanacademy/wonder-blocks-tokens@4.2.0
|
|
33
|
+
|
|
3
34
|
## 2.0.2
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
6
37
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
38
|
+
- Updated dependencies [0199324d]
|
|
39
|
+
- @khanacademy/wonder-blocks-core@12.0.0
|
|
40
|
+
- @khanacademy/wonder-blocks-layout@3.0.8
|
|
41
|
+
- @khanacademy/wonder-blocks-typography@3.0.6
|
|
11
42
|
|
|
12
43
|
## 2.0.1
|
|
13
44
|
|
|
14
45
|
### Patch Changes
|
|
15
46
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
47
|
+
- Updated dependencies [8cfaeab0]
|
|
48
|
+
- Updated dependencies [c162abb4]
|
|
49
|
+
- @khanacademy/wonder-blocks-tokens@4.1.0
|
|
50
|
+
- @khanacademy/wonder-blocks-layout@3.0.7
|
|
20
51
|
|
|
21
52
|
## 2.0.0
|
|
22
53
|
|
|
23
54
|
### Major Changes
|
|
24
55
|
|
|
25
|
-
-
|
|
56
|
+
- 8d26588f: Remove `light` variant/prop from `LabeledField` as it is no longer needed/recommended.
|
|
26
57
|
|
|
27
58
|
### Patch Changes
|
|
28
59
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
60
|
+
- Updated dependencies [0de25cd8]
|
|
61
|
+
- @khanacademy/wonder-blocks-tokens@4.0.0
|
|
62
|
+
- @khanacademy/wonder-blocks-layout@3.0.6
|
|
32
63
|
|
|
33
64
|
## 1.1.1
|
|
34
65
|
|
|
35
66
|
### Patch Changes
|
|
36
67
|
|
|
37
|
-
-
|
|
68
|
+
- dce7d780: Make labeled-field package public
|
|
38
69
|
|
|
39
70
|
## 1.1.0
|
|
40
71
|
|
|
41
72
|
### Minor Changes
|
|
42
73
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
74
|
+
- 0869c5ee: - Update `LabeledField` styling to use semantic tokens to match Figma specs
|
|
75
|
+
- Add error icon to the error message. This addresses accessibility issues related to color being the only way to communicate information
|
|
76
|
+
- Add a labels prop so that a translated label for the error icon can be passed in
|
|
77
|
+
- Handle long text overflow with and without word breaks
|
|
78
|
+
- dea7c71e: LabeledField: Wire up attributes for elements and apply attributes to the field element
|
|
48
79
|
|
|
49
80
|
### Patch Changes
|
|
50
81
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
82
|
+
- fd29f864: LabeledField: Refactor from class component to function component
|
|
83
|
+
- ed8fb7bd: Makes sure custom required messages passed into `LabeledField` or the `field` prop are displayed
|
|
84
|
+
- d9bc865b: Set required, error and light props for LabeledField and field component if it is set on either LabeledField or field component
|
|
85
|
+
- d9bc865b: Use `errorMessage` prop instead of `error` prop for consistency (`error` prop is used for boolean props in form field components).
|
|
86
|
+
- d9bc865b: LabeledField: Let `required` prop be a boolean or string so it can be passed down to the field prop
|
|
87
|
+
- daf459a1: Sets up the initial implementation for LabeledField based on the internal FieldHeading component in the form package
|
|
57
88
|
|
|
58
89
|
## 1.0.5
|
|
59
90
|
|
|
60
91
|
### Patch Changes
|
|
61
92
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
93
|
+
- Updated dependencies [7516b239]
|
|
94
|
+
- @khanacademy/wonder-blocks-core@11.1.0
|
|
95
|
+
- @khanacademy/wonder-blocks-layout@3.0.5
|
|
96
|
+
- @khanacademy/wonder-blocks-typography@3.0.5
|
|
66
97
|
|
|
67
98
|
## 1.0.4
|
|
68
99
|
|
|
69
100
|
### Patch Changes
|
|
70
101
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
102
|
+
- 11a0f5c6: No functional changes. Adding prepublishOnly script.
|
|
103
|
+
- Updated dependencies [11a0f5c6]
|
|
104
|
+
- @khanacademy/wonder-blocks-typography@3.0.4
|
|
105
|
+
- @khanacademy/wonder-blocks-layout@3.0.4
|
|
106
|
+
- @khanacademy/wonder-blocks-tokens@3.0.1
|
|
107
|
+
- @khanacademy/wonder-blocks-core@11.0.1
|
|
77
108
|
|
|
78
109
|
## 1.0.3
|
|
79
110
|
|
|
80
111
|
### Patch Changes
|
|
81
112
|
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
113
|
+
- Updated dependencies [d23c9c5f]
|
|
114
|
+
- @khanacademy/wonder-blocks-core@11.0.0
|
|
115
|
+
- @khanacademy/wonder-blocks-layout@3.0.3
|
|
116
|
+
- @khanacademy/wonder-blocks-typography@3.0.3
|
|
86
117
|
|
|
87
118
|
## 1.0.2
|
|
88
119
|
|
|
89
120
|
### Patch Changes
|
|
90
121
|
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
122
|
+
- Updated dependencies [b6009b77]
|
|
123
|
+
- Updated dependencies [897686bc]
|
|
124
|
+
- Updated dependencies [56d961f1]
|
|
125
|
+
- @khanacademy/wonder-blocks-core@10.0.0
|
|
126
|
+
- @khanacademy/wonder-blocks-layout@3.0.2
|
|
127
|
+
- @khanacademy/wonder-blocks-typography@3.0.2
|
|
97
128
|
|
|
98
129
|
## 1.0.1
|
|
99
130
|
|
|
100
131
|
### Patch Changes
|
|
101
132
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
133
|
+
- Updated dependencies [f4abd572]
|
|
134
|
+
- @khanacademy/wonder-blocks-core@9.0.0
|
|
135
|
+
- @khanacademy/wonder-blocks-layout@3.0.1
|
|
136
|
+
- @khanacademy/wonder-blocks-typography@3.0.1
|
|
106
137
|
|
|
107
138
|
## 1.0.0
|
|
108
139
|
|
|
109
140
|
### Major Changes
|
|
110
141
|
|
|
111
|
-
-
|
|
142
|
+
- e6abdd17: Upgrade to React 18
|
|
112
143
|
|
|
113
144
|
### Patch Changes
|
|
114
145
|
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
146
|
+
- Updated dependencies [e6abdd17]
|
|
147
|
+
- @khanacademy/wonder-blocks-core@8.0.0
|
|
148
|
+
- @khanacademy/wonder-blocks-layout@3.0.0
|
|
149
|
+
- @khanacademy/wonder-blocks-tokens@3.0.0
|
|
150
|
+
- @khanacademy/wonder-blocks-typography@3.0.0
|
|
120
151
|
|
|
121
152
|
## 0.1.21
|
|
122
153
|
|
|
123
154
|
### Patch Changes
|
|
124
155
|
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
156
|
+
- Updated dependencies [6999fd39]
|
|
157
|
+
- @khanacademy/wonder-blocks-tokens@2.1.0
|
|
158
|
+
- @khanacademy/wonder-blocks-layout@2.2.2
|
|
128
159
|
|
|
129
160
|
## 0.1.20
|
|
130
161
|
|
|
131
162
|
### Patch Changes
|
|
132
163
|
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
164
|
+
- 02a1b298: Make sure we don't package tsconfig and tsbuildinfo files
|
|
165
|
+
- Updated dependencies [02a1b298]
|
|
166
|
+
- @khanacademy/wonder-blocks-core@7.0.1
|
|
167
|
+
- @khanacademy/wonder-blocks-layout@2.2.1
|
|
168
|
+
- @khanacademy/wonder-blocks-tokens@2.0.1
|
|
169
|
+
- @khanacademy/wonder-blocks-typography@2.1.16
|
|
139
170
|
|
|
140
171
|
## 0.1.19
|
|
141
172
|
|
|
142
173
|
### Patch Changes
|
|
143
174
|
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
175
|
+
- Updated dependencies [07f7f407]
|
|
176
|
+
- @khanacademy/wonder-blocks-core@7.0.0
|
|
177
|
+
- @khanacademy/wonder-blocks-layout@2.2.0
|
|
178
|
+
- @khanacademy/wonder-blocks-typography@2.1.15
|
|
148
179
|
|
|
149
180
|
## 0.1.18
|
|
150
181
|
|
|
151
182
|
### Patch Changes
|
|
152
183
|
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
184
|
+
- Updated dependencies [f17dc1ee]
|
|
185
|
+
- Updated dependencies [991eb43f]
|
|
186
|
+
- @khanacademy/wonder-blocks-tokens@2.0.0
|
|
187
|
+
- @khanacademy/wonder-blocks-layout@2.1.3
|
|
157
188
|
|
|
158
189
|
## 0.1.17
|
|
159
190
|
|
|
160
191
|
### Patch Changes
|
|
161
192
|
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
193
|
+
- 559e82d5: Update to build tooling, generating smaller output
|
|
194
|
+
- Updated dependencies [559e82d5]
|
|
195
|
+
- @khanacademy/wonder-blocks-core@6.4.3
|
|
196
|
+
- @khanacademy/wonder-blocks-layout@2.1.2
|
|
197
|
+
- @khanacademy/wonder-blocks-tokens@1.3.1
|
|
198
|
+
- @khanacademy/wonder-blocks-typography@2.1.14
|
|
168
199
|
|
|
169
200
|
## 0.1.16
|
|
170
201
|
|
|
171
202
|
### Patch Changes
|
|
172
203
|
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
204
|
+
- Updated dependencies [eab37b8b]
|
|
205
|
+
- @khanacademy/wonder-blocks-core@6.4.2
|
|
206
|
+
- @khanacademy/wonder-blocks-layout@2.1.1
|
|
207
|
+
- @khanacademy/wonder-blocks-typography@2.1.13
|
|
177
208
|
|
|
178
209
|
## 0.1.15
|
|
179
210
|
|
|
180
211
|
### Patch Changes
|
|
181
212
|
|
|
182
|
-
-
|
|
183
|
-
-
|
|
213
|
+
- Updated dependencies [47a758b6]
|
|
214
|
+
- @khanacademy/wonder-blocks-layout@2.1.0
|
|
184
215
|
|
|
185
216
|
## 0.1.14
|
|
186
217
|
|
|
187
218
|
### Patch Changes
|
|
188
219
|
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
220
|
+
- Updated dependencies [5dfac06e]
|
|
221
|
+
- @khanacademy/wonder-blocks-core@6.4.1
|
|
222
|
+
- @khanacademy/wonder-blocks-layout@2.0.33
|
|
223
|
+
- @khanacademy/wonder-blocks-typography@2.1.12
|
|
193
224
|
|
|
194
225
|
## 0.1.13
|
|
195
226
|
|
|
196
227
|
### Patch Changes
|
|
197
228
|
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
229
|
+
- Updated dependencies [9bfeead9]
|
|
230
|
+
- @khanacademy/wonder-blocks-tokens@1.3.0
|
|
231
|
+
- @khanacademy/wonder-blocks-layout@2.0.32
|
|
201
232
|
|
|
202
233
|
## 0.1.12
|
|
203
234
|
|
|
204
235
|
### Patch Changes
|
|
205
236
|
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
237
|
+
- Updated dependencies [58075352]
|
|
238
|
+
- @khanacademy/wonder-blocks-core@6.4.0
|
|
239
|
+
- @khanacademy/wonder-blocks-layout@2.0.31
|
|
240
|
+
- @khanacademy/wonder-blocks-typography@2.1.11
|
|
210
241
|
|
|
211
242
|
## 0.1.11
|
|
212
243
|
|
|
213
244
|
### Patch Changes
|
|
214
245
|
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
246
|
+
- Updated dependencies [874081aa]
|
|
247
|
+
- Updated dependencies [874081aa]
|
|
248
|
+
- Updated dependencies [a9bf603a]
|
|
249
|
+
- @khanacademy/wonder-blocks-tokens@1.2.0
|
|
250
|
+
- @khanacademy/wonder-blocks-layout@2.0.30
|
|
220
251
|
|
|
221
252
|
## 0.1.10
|
|
222
253
|
|
|
223
254
|
### Patch Changes
|
|
224
255
|
|
|
225
|
-
-
|
|
226
|
-
-
|
|
256
|
+
- Updated dependencies [c39bfd29]
|
|
257
|
+
- @khanacademy/wonder-blocks-layout@2.0.29
|
|
227
258
|
|
|
228
259
|
## 0.1.9
|
|
229
260
|
|
|
230
261
|
### Patch Changes
|
|
231
262
|
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
-
|
|
263
|
+
- Updated dependencies [4cfb4977]
|
|
264
|
+
- @khanacademy/wonder-blocks-tokens@1.1.0
|
|
265
|
+
- @khanacademy/wonder-blocks-layout@2.0.28
|
|
235
266
|
|
|
236
267
|
## 0.1.8
|
|
237
268
|
|
|
238
269
|
### Patch Changes
|
|
239
270
|
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
271
|
+
- Updated dependencies [e83f8991]
|
|
272
|
+
- @khanacademy/wonder-blocks-tokens@1.0.0
|
|
273
|
+
- @khanacademy/wonder-blocks-layout@2.0.27
|
|
243
274
|
|
|
244
275
|
## 0.1.7
|
|
245
276
|
|
|
246
277
|
### Patch Changes
|
|
247
278
|
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
279
|
+
- 60aba5b8: Update internal spacing references (from wb-spacing to wb-tokens)
|
|
280
|
+
- 7c51f377: Migrate wb-color imports to use tokens.color
|
|
281
|
+
- Updated dependencies [60aba5b8]
|
|
282
|
+
- Updated dependencies [7cd7f6cc]
|
|
283
|
+
- Updated dependencies [7c51f377]
|
|
284
|
+
- @khanacademy/wonder-blocks-layout@2.0.26
|
|
285
|
+
- @khanacademy/wonder-blocks-tokens@0.2.0
|
|
255
286
|
|
|
256
287
|
## 0.1.6
|
|
257
288
|
|
|
258
289
|
### Patch Changes
|
|
259
290
|
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
291
|
+
- Updated dependencies [6df21f71]
|
|
292
|
+
- @khanacademy/wonder-blocks-core@6.3.1
|
|
293
|
+
- @khanacademy/wonder-blocks-layout@2.0.25
|
|
294
|
+
- @khanacademy/wonder-blocks-typography@2.1.10
|
|
264
295
|
|
|
265
296
|
## 0.1.5
|
|
266
297
|
|
|
267
298
|
### Patch Changes
|
|
268
299
|
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
300
|
+
- Updated dependencies [7055ca94]
|
|
301
|
+
- @khanacademy/wonder-blocks-core@6.3.0
|
|
302
|
+
- @khanacademy/wonder-blocks-layout@2.0.24
|
|
303
|
+
- @khanacademy/wonder-blocks-typography@2.1.9
|
|
273
304
|
|
|
274
305
|
## 0.1.4
|
|
275
306
|
|
|
276
307
|
### Patch Changes
|
|
277
308
|
|
|
278
|
-
-
|
|
279
|
-
-
|
|
309
|
+
- Updated dependencies [b6fbd635]
|
|
310
|
+
- @khanacademy/wonder-blocks-layout@2.0.23
|
|
280
311
|
|
|
281
312
|
## 0.1.3
|
|
282
313
|
|
|
283
314
|
### Patch Changes
|
|
284
315
|
|
|
285
|
-
-
|
|
286
|
-
-
|
|
316
|
+
- Updated dependencies [48d3c7e9]
|
|
317
|
+
- @khanacademy/wonder-blocks-color@3.0.0
|
|
287
318
|
|
|
288
319
|
## 0.1.2
|
|
289
320
|
|
|
290
321
|
### Patch Changes
|
|
291
322
|
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
323
|
+
- Updated dependencies [4b97b9a2]
|
|
324
|
+
- @khanacademy/wonder-blocks-core@6.2.0
|
|
325
|
+
- @khanacademy/wonder-blocks-layout@2.0.22
|
|
326
|
+
- @khanacademy/wonder-blocks-typography@2.1.8
|
|
296
327
|
|
|
297
328
|
## 0.1.1
|
|
298
329
|
|
|
299
330
|
### Patch Changes
|
|
300
331
|
|
|
301
|
-
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
332
|
+
- Updated dependencies [2871f0a9]
|
|
333
|
+
- @khanacademy/wonder-blocks-core@6.1.1
|
|
334
|
+
- @khanacademy/wonder-blocks-layout@2.0.21
|
|
335
|
+
- @khanacademy/wonder-blocks-typography@2.1.7
|
|
305
336
|
|
|
306
337
|
## 0.1.0
|
|
307
338
|
|
|
308
339
|
### Minor Changes
|
|
309
340
|
|
|
310
|
-
-
|
|
341
|
+
- db74f86f: Add skeleton for new labeled field package
|
|
311
342
|
|
|
312
343
|
### Patch Changes
|
|
313
344
|
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
-
|
|
345
|
+
- Updated dependencies [efb59c29]
|
|
346
|
+
- Updated dependencies [8bc40ed2]
|
|
347
|
+
- @khanacademy/wonder-blocks-core@6.1.0
|
|
348
|
+
- @khanacademy/wonder-blocks-layout@2.0.20
|
|
349
|
+
- @khanacademy/wonder-blocks-typography@2.1.6
|
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
|
@@ -5,69 +5,7 @@ import { addStyle, View } from '@khanacademy/wonder-blocks-core';
|
|
|
5
5
|
import { Strut } from '@khanacademy/wonder-blocks-layout';
|
|
6
6
|
import { semanticColor, spacing } from '@khanacademy/wonder-blocks-tokens';
|
|
7
7
|
import { LabelMedium, LabelSmall } from '@khanacademy/wonder-blocks-typography';
|
|
8
|
-
import
|
|
9
|
-
import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';
|
|
10
|
-
|
|
11
|
-
const viewportPixelsForSize = size => ({
|
|
12
|
-
small: 16,
|
|
13
|
-
medium: 24,
|
|
14
|
-
large: 48,
|
|
15
|
-
xlarge: 96
|
|
16
|
-
})[size];
|
|
17
|
-
const _excluded = ["color", "icon", "size", "style", "testId", "className", "role"];
|
|
18
|
-
const StyledIcon = addStyle("span");
|
|
19
|
-
const PhosphorIcon = React.forwardRef(function PhosphorIcon(props, ref) {
|
|
20
|
-
const {
|
|
21
|
-
color = "currentColor",
|
|
22
|
-
icon,
|
|
23
|
-
size = "small",
|
|
24
|
-
style,
|
|
25
|
-
testId,
|
|
26
|
-
className,
|
|
27
|
-
role
|
|
28
|
-
} = props,
|
|
29
|
-
sharedProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
|
-
const pixelSize = viewportPixelsForSize(size);
|
|
31
|
-
const classNames = `${className != null ? className : ""}`;
|
|
32
|
-
const iconStyles = _generateStyles(color, pixelSize);
|
|
33
|
-
return React.createElement(StyledIcon, _extends({}, sharedProps, {
|
|
34
|
-
className: classNames,
|
|
35
|
-
style: [styles$1.svg, iconStyles.icon, {
|
|
36
|
-
maskImage: `url(${icon})`
|
|
37
|
-
}, style],
|
|
38
|
-
"data-testid": testId,
|
|
39
|
-
ref: ref,
|
|
40
|
-
role: (role != null ? role : sharedProps["aria-label"]) ? "img" : undefined
|
|
41
|
-
}));
|
|
42
|
-
});
|
|
43
|
-
const dynamicStyles = {};
|
|
44
|
-
const _generateStyles = (color, size) => {
|
|
45
|
-
const iconStyle = `${color}-${size}`;
|
|
46
|
-
if (styles$1[iconStyle]) {
|
|
47
|
-
return styles$1[iconStyle];
|
|
48
|
-
}
|
|
49
|
-
const newStyles = {
|
|
50
|
-
icon: {
|
|
51
|
-
backgroundColor: color,
|
|
52
|
-
width: size,
|
|
53
|
-
height: size
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
dynamicStyles[iconStyle] = StyleSheet.create(newStyles);
|
|
57
|
-
return dynamicStyles[iconStyle];
|
|
58
|
-
};
|
|
59
|
-
const styles$1 = StyleSheet.create({
|
|
60
|
-
svg: {
|
|
61
|
-
display: "inline-block",
|
|
62
|
-
verticalAlign: "text-bottom",
|
|
63
|
-
flexShrink: 0,
|
|
64
|
-
flexGrow: 0,
|
|
65
|
-
maskSize: "100%",
|
|
66
|
-
maskRepeat: "no-repeat",
|
|
67
|
-
maskPosition: "center"
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
PhosphorIcon.displayName = "PhosphorIcon";
|
|
8
|
+
import { PhosphorIcon } from '@khanacademy/wonder-blocks-icon';
|
|
71
9
|
|
|
72
10
|
const defaultLabeledFieldLabels = {
|
|
73
11
|
errorIconAriaLabel: "Error:"
|
package/dist/index.js
CHANGED
|
@@ -9,94 +9,30 @@ var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
|
9
9
|
var wonderBlocksLayout = require('@khanacademy/wonder-blocks-layout');
|
|
10
10
|
var wonderBlocksTokens = require('@khanacademy/wonder-blocks-tokens');
|
|
11
11
|
var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
|
|
12
|
-
var
|
|
13
|
-
var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose');
|
|
12
|
+
var wonderBlocksIcon = require('@khanacademy/wonder-blocks-icon');
|
|
14
13
|
|
|
15
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
15
|
|
|
17
16
|
function _interopNamespace(e) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
if (e && e.__esModule) return e;
|
|
18
|
+
var n = Object.create(null);
|
|
19
|
+
if (e) {
|
|
20
|
+
Object.keys(e).forEach(function (k) {
|
|
21
|
+
if (k !== 'default') {
|
|
22
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
23
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return e[k]; }
|
|
26
|
+
});
|
|
27
|
+
}
|
|
27
28
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
n["default"] = e;
|
|
32
|
-
return Object.freeze(n);
|
|
29
|
+
}
|
|
30
|
+
n["default"] = e;
|
|
31
|
+
return Object.freeze(n);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
36
35
|
var WarningCircle__default = /*#__PURE__*/_interopDefaultLegacy(WarningCircle);
|
|
37
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
38
|
-
var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose);
|
|
39
|
-
|
|
40
|
-
const viewportPixelsForSize = size => ({
|
|
41
|
-
small: 16,
|
|
42
|
-
medium: 24,
|
|
43
|
-
large: 48,
|
|
44
|
-
xlarge: 96
|
|
45
|
-
})[size];
|
|
46
|
-
const _excluded = ["color", "icon", "size", "style", "testId", "className", "role"];
|
|
47
|
-
const StyledIcon = wonderBlocksCore.addStyle("span");
|
|
48
|
-
const PhosphorIcon = React__namespace.forwardRef(function PhosphorIcon(props, ref) {
|
|
49
|
-
const {
|
|
50
|
-
color = "currentColor",
|
|
51
|
-
icon,
|
|
52
|
-
size = "small",
|
|
53
|
-
style,
|
|
54
|
-
testId,
|
|
55
|
-
className,
|
|
56
|
-
role
|
|
57
|
-
} = props,
|
|
58
|
-
sharedProps = _objectWithoutPropertiesLoose__default["default"](props, _excluded);
|
|
59
|
-
const pixelSize = viewportPixelsForSize(size);
|
|
60
|
-
const classNames = `${className != null ? className : ""}`;
|
|
61
|
-
const iconStyles = _generateStyles(color, pixelSize);
|
|
62
|
-
return React__namespace.createElement(StyledIcon, _extends__default["default"]({}, sharedProps, {
|
|
63
|
-
className: classNames,
|
|
64
|
-
style: [styles$1.svg, iconStyles.icon, {
|
|
65
|
-
maskImage: `url(${icon})`
|
|
66
|
-
}, style],
|
|
67
|
-
"data-testid": testId,
|
|
68
|
-
ref: ref,
|
|
69
|
-
role: (role != null ? role : sharedProps["aria-label"]) ? "img" : undefined
|
|
70
|
-
}));
|
|
71
|
-
});
|
|
72
|
-
const dynamicStyles = {};
|
|
73
|
-
const _generateStyles = (color, size) => {
|
|
74
|
-
const iconStyle = `${color}-${size}`;
|
|
75
|
-
if (styles$1[iconStyle]) {
|
|
76
|
-
return styles$1[iconStyle];
|
|
77
|
-
}
|
|
78
|
-
const newStyles = {
|
|
79
|
-
icon: {
|
|
80
|
-
backgroundColor: color,
|
|
81
|
-
width: size,
|
|
82
|
-
height: size
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
dynamicStyles[iconStyle] = aphrodite.StyleSheet.create(newStyles);
|
|
86
|
-
return dynamicStyles[iconStyle];
|
|
87
|
-
};
|
|
88
|
-
const styles$1 = aphrodite.StyleSheet.create({
|
|
89
|
-
svg: {
|
|
90
|
-
display: "inline-block",
|
|
91
|
-
verticalAlign: "text-bottom",
|
|
92
|
-
flexShrink: 0,
|
|
93
|
-
flexGrow: 0,
|
|
94
|
-
maskSize: "100%",
|
|
95
|
-
maskRepeat: "no-repeat",
|
|
96
|
-
maskPosition: "center"
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
PhosphorIcon.displayName = "PhosphorIcon";
|
|
100
36
|
|
|
101
37
|
const defaultLabeledFieldLabels = {
|
|
102
38
|
errorIconAriaLabel: "Error:"
|
|
@@ -156,7 +92,7 @@ function LabeledField(props) {
|
|
|
156
92
|
testId: testId && `${testId}-error`,
|
|
157
93
|
"aria-live": "assertive",
|
|
158
94
|
"aria-atomic": "true"
|
|
159
|
-
}, errorMessage && React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(PhosphorIcon, {
|
|
95
|
+
}, errorMessage && React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
160
96
|
icon: WarningCircle__default["default"],
|
|
161
97
|
style: [styles.errorIcon, styles.error],
|
|
162
98
|
role: "img",
|
package/package.json
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-labeled-field",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"description": "LabeledField handles accessibility and layout for associating labels with form components.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/es/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
-
"prepublishOnly": "../../utils/publish/package-pre-publish-check.sh"
|
|
12
|
-
},
|
|
13
9
|
"author": "",
|
|
14
10
|
"license": "MIT",
|
|
15
11
|
"publishConfig": {
|
|
16
12
|
"access": "public"
|
|
17
13
|
},
|
|
18
14
|
"dependencies": {
|
|
19
|
-
"@babel/runtime": "^7.
|
|
20
|
-
"@khanacademy/wonder-blocks-core": "
|
|
21
|
-
"@khanacademy/wonder-blocks-layout": "
|
|
22
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
23
|
-
"@khanacademy/wonder-blocks-typography": "
|
|
15
|
+
"@babel/runtime": "^7.24.5",
|
|
16
|
+
"@khanacademy/wonder-blocks-core": "12.1.1",
|
|
17
|
+
"@khanacademy/wonder-blocks-layout": "3.1.1",
|
|
18
|
+
"@khanacademy/wonder-blocks-tokens": "4.2.1",
|
|
19
|
+
"@khanacademy/wonder-blocks-typography": "3.1.1"
|
|
24
20
|
},
|
|
25
21
|
"peerDependencies": {
|
|
26
22
|
"@phosphor-icons/core": "^2.0.2",
|
|
@@ -28,6 +24,9 @@
|
|
|
28
24
|
"react": "18.2.0"
|
|
29
25
|
},
|
|
30
26
|
"devDependencies": {
|
|
31
|
-
"@khanacademy/wb-dev-build-settings": "
|
|
27
|
+
"@khanacademy/wb-dev-build-settings": "2.1.1"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
32
31
|
}
|
|
33
32
|
}
|