@mirai/ui 1.0.221 → 1.1.0-beta
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/build/components/Action/Action.js +5 -3
- package/build/components/Action/Action.js.map +1 -1
- package/build/components/Action/Action.module.css +49 -50
- package/build/components/Action/Action.stories.js +8 -5
- package/build/components/Action/Action.stories.js.map +1 -1
- package/build/components/Action/__tests__/__snapshots__/Action.test.js.snap +40 -26
- package/build/components/Button/Button.js +7 -5
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Button/__tests__/__snapshots__/Button.test.js.snap +30 -19
- package/build/components/Calendar/Calendar.Month.js +6 -4
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/Calendar.Week.js +6 -6
- package/build/components/Calendar/Calendar.Week.js.map +1 -1
- package/build/components/Calendar/Calendar.Weekdays.js +6 -3
- package/build/components/Calendar/Calendar.Weekdays.js.map +1 -1
- package/build/components/Calendar/Calendar.js +3 -3
- package/build/components/Calendar/Calendar.js.map +1 -1
- package/build/components/Calendar/__tests__/__snapshots__/Calendar.test.jsx.snap +15608 -15576
- package/build/components/Form/__tests__/__snapshots__/Form.test.jsx.snap +9 -9
- package/build/components/InputDate/__tests__/__snapshots__/InputDate.test.js.snap +42 -42
- package/build/components/InputNumber/InputNumber.js +9 -7
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +129 -114
- package/build/components/InputOption/InputOption.js +7 -4
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputOption/__tests__/__snapshots__/InputOption.test.js.snap +84 -71
- package/build/components/InputPhone/InputPhone.js +11 -11
- package/build/components/InputPhone/InputPhone.js.map +1 -1
- package/build/components/InputPhone/__tests__/__snapshots__/InputPhone.test.js.snap +331 -331
- package/build/components/InputSelect/InputSelect.js +7 -7
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +112 -112
- package/build/components/InputText/InputText.js +10 -10
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +131 -130
- package/build/components/InputText/partials/InputText.Hint.js +5 -2
- package/build/components/InputText/partials/InputText.Hint.js.map +1 -1
- package/build/components/InputText/partials/InputText.IconState.js +5 -2
- package/build/components/InputText/partials/InputText.IconState.js.map +1 -1
- package/build/components/InputText/partials/InputText.Label.js +6 -3
- package/build/components/InputText/partials/InputText.Label.js.map +1 -1
- package/build/components/Menu/Menu.Option.js +8 -5
- package/build/components/Menu/Menu.Option.js.map +1 -1
- package/build/components/Menu/Menu.js +6 -3
- package/build/components/Menu/Menu.js.map +1 -1
- package/build/components/Menu/__tests__/__snapshots__/Menu.test.jsx.snap +68 -55
- package/build/components/Modal/Modal.js +8 -8
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +88 -69
- package/build/components/Notification/Notification.js +8 -5
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +143 -142
- package/build/components/Progress/Progress.js +6 -3
- package/build/components/Progress/Progress.js.map +1 -1
- package/build/components/Progress/__tests__/__snapshots__/Progress.test.jsx.snap +18 -18
- package/build/components/Slider/Slider.js +11 -11
- package/build/components/Slider/Slider.js.map +1 -1
- package/build/components/Slider/__tests__/__snapshots__/Slider.test.js.snap +248 -230
- package/build/components/Table/Table.ColumnFilter.js +9 -9
- package/build/components/Table/Table.ColumnFilter.js.map +1 -1
- package/build/components/Table/Table.Filter.js +7 -4
- package/build/components/Table/Table.Filter.js.map +1 -1
- package/build/components/Table/Table.Row.js +7 -8
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/components/Table/Table.js +3 -3
- package/build/components/Table/Table.js.map +1 -1
- package/build/components/Table/Table.stories.js +4 -5
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/__tests__/__snapshots__/Table.ColumnFilter.test.js.snap +222 -192
- package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +971 -949
- package/build/components/Tooltip/Tooltip.js +4 -4
- package/build/components/Tooltip/Tooltip.js.map +1 -1
- package/build/components/Tooltip/__tests__/__snapshots__/Tooltip.test.jsx.snap +34 -24
- package/build/primitives/Checkbox/Checkbox.js +7 -3
- package/build/primitives/Checkbox/Checkbox.js.map +1 -1
- package/build/primitives/Checkbox/__tests__/__snapshots__/Checkbox.test.js.snap +16 -16
- package/build/primitives/Icon/Icon.js +5 -3
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +60 -60
- package/build/primitives/Input/Input.js +2 -2
- package/build/primitives/Input/Input.js.map +1 -1
- package/build/primitives/Layer/Layer.js +4 -3
- package/build/primitives/Layer/Layer.js.map +1 -1
- package/build/primitives/Layer/__tests__/__snapshots__/Layer.test.js.snap +42 -36
- package/build/primitives/Pressable/Pressable.constants.js +1 -1
- package/build/primitives/Pressable/Pressable.constants.js.map +1 -1
- package/build/primitives/Pressable/Pressable.js +11 -5
- package/build/primitives/Pressable/Pressable.js.map +1 -1
- package/build/primitives/Pressable/__tests__/__snapshots__/Pressable.test.js.snap +14 -10
- package/build/primitives/Primitive/Primitive.js +2 -2
- package/build/primitives/Primitive/Primitive.js.map +1 -1
- package/build/primitives/Primitive/Primitive.module.css +241 -0
- package/build/primitives/Primitive/__tests__/__snapshots__/Primitive.test.js.snap +7 -7
- package/build/primitives/Primitive/helpers/getTag.js +32 -0
- package/build/primitives/Primitive/helpers/getTag.js.map +1 -0
- package/build/primitives/Primitive/helpers/index.js +11 -0
- package/build/primitives/Primitive/helpers/index.js.map +1 -1
- package/build/primitives/Radio/Radio.js +8 -5
- package/build/primitives/Radio/Radio.js.map +1 -1
- package/build/primitives/Radio/__tests__/__snapshots__/Radio.test.js.snap +21 -21
- package/build/primitives/ScrollView/ScrollView.js +3 -3
- package/build/primitives/ScrollView/ScrollView.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.stories.js +6 -5
- package/build/primitives/ScrollView/ScrollView.stories.js.map +1 -1
- package/build/primitives/ScrollView/__tests__/__snapshots__/ScrollView.test.js.snap +20 -20
- package/build/primitives/Select/Select.js +2 -2
- package/build/primitives/Select/Select.js.map +1 -1
- package/build/primitives/Switch/Switch.js +8 -5
- package/build/primitives/Switch/Switch.js.map +1 -1
- package/build/primitives/Switch/__tests__/__snapshots__/Switch.test.js.snap +25 -25
- package/build/primitives/Text/Text.js +7 -4
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/Text.module.css +4 -4
- package/build/primitives/Text/__tests__/__snapshots__/Text.test.js.snap +38 -38
- package/build/primitives/View/View.js +5 -3
- package/build/primitives/View/View.js.map +1 -1
- package/build/primitives/View/__tests__/__snapshots__/View.test.js.snap +10 -10
- package/package.json +5 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`primitive:<Icon> inherit:className 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
5
|
+
<ui_icon
|
|
6
6
|
class="icon headline-3 mirai"
|
|
7
7
|
>
|
|
8
8
|
<svg
|
|
@@ -22,13 +22,13 @@ exports[`primitive:<Icon> inherit:className 1`] = `
|
|
|
22
22
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
23
23
|
/>
|
|
24
24
|
</svg>
|
|
25
|
-
</
|
|
25
|
+
</ui_icon>
|
|
26
26
|
</DocumentFragment>
|
|
27
27
|
`;
|
|
28
28
|
|
|
29
29
|
exports[`primitive:<Icon> prop:action 1`] = `
|
|
30
30
|
<DocumentFragment>
|
|
31
|
-
<
|
|
31
|
+
<ui_icon
|
|
32
32
|
class="icon action"
|
|
33
33
|
>
|
|
34
34
|
<svg
|
|
@@ -48,13 +48,13 @@ exports[`primitive:<Icon> prop:action 1`] = `
|
|
|
48
48
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
49
49
|
/>
|
|
50
50
|
</svg>
|
|
51
|
-
</
|
|
51
|
+
</ui_icon>
|
|
52
52
|
</DocumentFragment>
|
|
53
53
|
`;
|
|
54
54
|
|
|
55
55
|
exports[`primitive:<Icon> prop:headline & level:1 1`] = `
|
|
56
56
|
<DocumentFragment>
|
|
57
|
-
<
|
|
57
|
+
<ui_icon
|
|
58
58
|
class="icon headline-1"
|
|
59
59
|
>
|
|
60
60
|
<svg
|
|
@@ -74,13 +74,13 @@ exports[`primitive:<Icon> prop:headline & level:1 1`] = `
|
|
|
74
74
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
75
75
|
/>
|
|
76
76
|
</svg>
|
|
77
|
-
</
|
|
77
|
+
</ui_icon>
|
|
78
78
|
</DocumentFragment>
|
|
79
79
|
`;
|
|
80
80
|
|
|
81
81
|
exports[`primitive:<Icon> prop:headline & level:2 1`] = `
|
|
82
82
|
<DocumentFragment>
|
|
83
|
-
<
|
|
83
|
+
<ui_icon
|
|
84
84
|
class="icon headline-2"
|
|
85
85
|
>
|
|
86
86
|
<svg
|
|
@@ -100,13 +100,13 @@ exports[`primitive:<Icon> prop:headline & level:2 1`] = `
|
|
|
100
100
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
101
101
|
/>
|
|
102
102
|
</svg>
|
|
103
|
-
</
|
|
103
|
+
</ui_icon>
|
|
104
104
|
</DocumentFragment>
|
|
105
105
|
`;
|
|
106
106
|
|
|
107
107
|
exports[`primitive:<Icon> prop:headline & level:3 1`] = `
|
|
108
108
|
<DocumentFragment>
|
|
109
|
-
<
|
|
109
|
+
<ui_icon
|
|
110
110
|
class="icon headline-3"
|
|
111
111
|
>
|
|
112
112
|
<svg
|
|
@@ -126,13 +126,13 @@ exports[`primitive:<Icon> prop:headline & level:3 1`] = `
|
|
|
126
126
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
127
127
|
/>
|
|
128
128
|
</svg>
|
|
129
|
-
</
|
|
129
|
+
</ui_icon>
|
|
130
130
|
</DocumentFragment>
|
|
131
131
|
`;
|
|
132
132
|
|
|
133
133
|
exports[`primitive:<Icon> prop:headline & level:4 1`] = `
|
|
134
134
|
<DocumentFragment>
|
|
135
|
-
<
|
|
135
|
+
<ui_icon
|
|
136
136
|
class="icon headline-4"
|
|
137
137
|
>
|
|
138
138
|
<svg
|
|
@@ -152,13 +152,13 @@ exports[`primitive:<Icon> prop:headline & level:4 1`] = `
|
|
|
152
152
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
153
153
|
/>
|
|
154
154
|
</svg>
|
|
155
|
-
</
|
|
155
|
+
</ui_icon>
|
|
156
156
|
</DocumentFragment>
|
|
157
157
|
`;
|
|
158
158
|
|
|
159
159
|
exports[`primitive:<Icon> prop:headline 1`] = `
|
|
160
160
|
<DocumentFragment>
|
|
161
|
-
<
|
|
161
|
+
<ui_icon
|
|
162
162
|
class="icon headline-3"
|
|
163
163
|
>
|
|
164
164
|
<svg
|
|
@@ -178,13 +178,13 @@ exports[`primitive:<Icon> prop:headline 1`] = `
|
|
|
178
178
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
179
179
|
/>
|
|
180
180
|
</svg>
|
|
181
|
-
</
|
|
181
|
+
</ui_icon>
|
|
182
182
|
</DocumentFragment>
|
|
183
183
|
`;
|
|
184
184
|
|
|
185
185
|
exports[`primitive:<Icon> prop:paragraph 1`] = `
|
|
186
186
|
<DocumentFragment>
|
|
187
|
-
<
|
|
187
|
+
<ui_icon
|
|
188
188
|
class="icon paragraph"
|
|
189
189
|
>
|
|
190
190
|
<svg
|
|
@@ -204,13 +204,13 @@ exports[`primitive:<Icon> prop:paragraph 1`] = `
|
|
|
204
204
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
205
205
|
/>
|
|
206
206
|
</svg>
|
|
207
|
-
</
|
|
207
|
+
</ui_icon>
|
|
208
208
|
</DocumentFragment>
|
|
209
209
|
`;
|
|
210
210
|
|
|
211
211
|
exports[`primitive:<Icon> prop:small 1`] = `
|
|
212
212
|
<DocumentFragment>
|
|
213
|
-
<
|
|
213
|
+
<ui_icon
|
|
214
214
|
class="icon small"
|
|
215
215
|
>
|
|
216
216
|
<svg
|
|
@@ -230,13 +230,13 @@ exports[`primitive:<Icon> prop:small 1`] = `
|
|
|
230
230
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
231
231
|
/>
|
|
232
232
|
</svg>
|
|
233
|
-
</
|
|
233
|
+
</ui_icon>
|
|
234
234
|
</DocumentFragment>
|
|
235
235
|
`;
|
|
236
236
|
|
|
237
237
|
exports[`primitive:<Icon> prop:value prop:value (ADD) 1`] = `
|
|
238
238
|
<DocumentFragment>
|
|
239
|
-
<
|
|
239
|
+
<ui_icon
|
|
240
240
|
class="icon headline-3"
|
|
241
241
|
>
|
|
242
242
|
<svg
|
|
@@ -256,13 +256,13 @@ exports[`primitive:<Icon> prop:value prop:value (ADD) 1`] = `
|
|
|
256
256
|
d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
257
257
|
/>
|
|
258
258
|
</svg>
|
|
259
|
-
</
|
|
259
|
+
</ui_icon>
|
|
260
260
|
</DocumentFragment>
|
|
261
261
|
`;
|
|
262
262
|
|
|
263
263
|
exports[`primitive:<Icon> prop:value prop:value (CHECK) 1`] = `
|
|
264
264
|
<DocumentFragment>
|
|
265
|
-
<
|
|
265
|
+
<ui_icon
|
|
266
266
|
class="icon headline-3"
|
|
267
267
|
>
|
|
268
268
|
<svg
|
|
@@ -282,13 +282,13 @@ exports[`primitive:<Icon> prop:value prop:value (CHECK) 1`] = `
|
|
|
282
282
|
d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"
|
|
283
283
|
/>
|
|
284
284
|
</svg>
|
|
285
|
-
</
|
|
285
|
+
</ui_icon>
|
|
286
286
|
</DocumentFragment>
|
|
287
287
|
`;
|
|
288
288
|
|
|
289
289
|
exports[`primitive:<Icon> prop:value prop:value (CLOSE) 1`] = `
|
|
290
290
|
<DocumentFragment>
|
|
291
|
-
<
|
|
291
|
+
<ui_icon
|
|
292
292
|
class="icon headline-3"
|
|
293
293
|
>
|
|
294
294
|
<svg
|
|
@@ -308,13 +308,13 @@ exports[`primitive:<Icon> prop:value prop:value (CLOSE) 1`] = `
|
|
|
308
308
|
d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
309
309
|
/>
|
|
310
310
|
</svg>
|
|
311
|
-
</
|
|
311
|
+
</ui_icon>
|
|
312
312
|
</DocumentFragment>
|
|
313
313
|
`;
|
|
314
314
|
|
|
315
315
|
exports[`primitive:<Icon> prop:value prop:value (DOWN) 1`] = `
|
|
316
316
|
<DocumentFragment>
|
|
317
|
-
<
|
|
317
|
+
<ui_icon
|
|
318
318
|
class="icon headline-3"
|
|
319
319
|
>
|
|
320
320
|
<svg
|
|
@@ -334,13 +334,13 @@ exports[`primitive:<Icon> prop:value prop:value (DOWN) 1`] = `
|
|
|
334
334
|
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
335
335
|
/>
|
|
336
336
|
</svg>
|
|
337
|
-
</
|
|
337
|
+
</ui_icon>
|
|
338
338
|
</DocumentFragment>
|
|
339
339
|
`;
|
|
340
340
|
|
|
341
341
|
exports[`primitive:<Icon> prop:value prop:value (ERROR) 1`] = `
|
|
342
342
|
<DocumentFragment>
|
|
343
|
-
<
|
|
343
|
+
<ui_icon
|
|
344
344
|
class="icon headline-3"
|
|
345
345
|
>
|
|
346
346
|
<svg
|
|
@@ -360,13 +360,13 @@ exports[`primitive:<Icon> prop:value prop:value (ERROR) 1`] = `
|
|
|
360
360
|
d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
361
361
|
/>
|
|
362
362
|
</svg>
|
|
363
|
-
</
|
|
363
|
+
</ui_icon>
|
|
364
364
|
</DocumentFragment>
|
|
365
365
|
`;
|
|
366
366
|
|
|
367
367
|
exports[`primitive:<Icon> prop:value prop:value (EXPAND_LESS) 1`] = `
|
|
368
368
|
<DocumentFragment>
|
|
369
|
-
<
|
|
369
|
+
<ui_icon
|
|
370
370
|
class="icon headline-3"
|
|
371
371
|
>
|
|
372
372
|
<svg
|
|
@@ -386,13 +386,13 @@ exports[`primitive:<Icon> prop:value prop:value (EXPAND_LESS) 1`] = `
|
|
|
386
386
|
d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14l-6-6z"
|
|
387
387
|
/>
|
|
388
388
|
</svg>
|
|
389
|
-
</
|
|
389
|
+
</ui_icon>
|
|
390
390
|
</DocumentFragment>
|
|
391
391
|
`;
|
|
392
392
|
|
|
393
393
|
exports[`primitive:<Icon> prop:value prop:value (EXPAND_MORE) 1`] = `
|
|
394
394
|
<DocumentFragment>
|
|
395
|
-
<
|
|
395
|
+
<ui_icon
|
|
396
396
|
class="icon headline-3"
|
|
397
397
|
>
|
|
398
398
|
<svg
|
|
@@ -413,13 +413,13 @@ exports[`primitive:<Icon> prop:value prop:value (EXPAND_MORE) 1`] = `
|
|
|
413
413
|
d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"
|
|
414
414
|
/>
|
|
415
415
|
</svg>
|
|
416
|
-
</
|
|
416
|
+
</ui_icon>
|
|
417
417
|
</DocumentFragment>
|
|
418
418
|
`;
|
|
419
419
|
|
|
420
420
|
exports[`primitive:<Icon> prop:value prop:value (EYE_CLOSE) 1`] = `
|
|
421
421
|
<DocumentFragment>
|
|
422
|
-
<
|
|
422
|
+
<ui_icon
|
|
423
423
|
class="icon headline-3"
|
|
424
424
|
>
|
|
425
425
|
<svg
|
|
@@ -439,13 +439,13 @@ exports[`primitive:<Icon> prop:value prop:value (EYE_CLOSE) 1`] = `
|
|
|
439
439
|
d="M12 6a9.77 9.77 0 018.82 5.5 9.647 9.647 0 01-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68A11.738 11.738 0 001 11.5C2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5l2.61 2.61c-.04.01-.08.02-.12.02a2.5 2.5 0 01-2.5-2.5c0-.05.01-.08.01-.13zm-3.4-3.4l1.75 1.75a4.6 4.6 0 00-.36 1.78 4.507 4.507 0 006.27 4.14l.98.98c-.88.24-1.8.38-2.75.38a9.77 9.77 0 01-8.82-5.5c.7-1.43 1.72-2.61 2.93-3.53z"
|
|
440
440
|
/>
|
|
441
441
|
</svg>
|
|
442
|
-
</
|
|
442
|
+
</ui_icon>
|
|
443
443
|
</DocumentFragment>
|
|
444
444
|
`;
|
|
445
445
|
|
|
446
446
|
exports[`primitive:<Icon> prop:value prop:value (EYE_OPEN) 1`] = `
|
|
447
447
|
<DocumentFragment>
|
|
448
|
-
<
|
|
448
|
+
<ui_icon
|
|
449
449
|
class="icon headline-3"
|
|
450
450
|
>
|
|
451
451
|
<svg
|
|
@@ -465,13 +465,13 @@ exports[`primitive:<Icon> prop:value prop:value (EYE_OPEN) 1`] = `
|
|
|
465
465
|
d="M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"
|
|
466
466
|
/>
|
|
467
467
|
</svg>
|
|
468
|
-
</
|
|
468
|
+
</ui_icon>
|
|
469
469
|
</DocumentFragment>
|
|
470
470
|
`;
|
|
471
471
|
|
|
472
472
|
exports[`primitive:<Icon> prop:value prop:value (FILTER) 1`] = `
|
|
473
473
|
<DocumentFragment>
|
|
474
|
-
<
|
|
474
|
+
<ui_icon
|
|
475
475
|
class="icon headline-3"
|
|
476
476
|
>
|
|
477
477
|
<svg
|
|
@@ -491,13 +491,13 @@ exports[`primitive:<Icon> prop:value prop:value (FILTER) 1`] = `
|
|
|
491
491
|
d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
|
|
492
492
|
/>
|
|
493
493
|
</svg>
|
|
494
|
-
</
|
|
494
|
+
</ui_icon>
|
|
495
495
|
</DocumentFragment>
|
|
496
496
|
`;
|
|
497
497
|
|
|
498
498
|
exports[`primitive:<Icon> prop:value prop:value (INFO) 1`] = `
|
|
499
499
|
<DocumentFragment>
|
|
500
|
-
<
|
|
500
|
+
<ui_icon
|
|
501
501
|
class="icon headline-3"
|
|
502
502
|
>
|
|
503
503
|
<svg
|
|
@@ -517,13 +517,13 @@ exports[`primitive:<Icon> prop:value prop:value (INFO) 1`] = `
|
|
|
517
517
|
d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"
|
|
518
518
|
/>
|
|
519
519
|
</svg>
|
|
520
|
-
</
|
|
520
|
+
</ui_icon>
|
|
521
521
|
</DocumentFragment>
|
|
522
522
|
`;
|
|
523
523
|
|
|
524
524
|
exports[`primitive:<Icon> prop:value prop:value (LEFT) 1`] = `
|
|
525
525
|
<DocumentFragment>
|
|
526
|
-
<
|
|
526
|
+
<ui_icon
|
|
527
527
|
class="icon headline-3"
|
|
528
528
|
>
|
|
529
529
|
<svg
|
|
@@ -543,13 +543,13 @@ exports[`primitive:<Icon> prop:value prop:value (LEFT) 1`] = `
|
|
|
543
543
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
544
544
|
/>
|
|
545
545
|
</svg>
|
|
546
|
-
</
|
|
546
|
+
</ui_icon>
|
|
547
547
|
</DocumentFragment>
|
|
548
548
|
`;
|
|
549
549
|
|
|
550
550
|
exports[`primitive:<Icon> prop:value prop:value (MARKDOWN) 1`] = `
|
|
551
551
|
<DocumentFragment>
|
|
552
|
-
<
|
|
552
|
+
<ui_icon
|
|
553
553
|
class="icon headline-3"
|
|
554
554
|
>
|
|
555
555
|
<svg
|
|
@@ -565,13 +565,13 @@ exports[`primitive:<Icon> prop:value prop:value (MARKDOWN) 1`] = `
|
|
|
565
565
|
d="M 2.875 6 C 1.320313 6 0 7.253906 0 8.8125 L 0 23.1875 C 0 24.746094 1.320313 26 2.875 26 L 29.125 26 C 30.679688 26 32 24.746094 32 23.1875 L 32 8.8125 C 32 7.253906 30.679688 6 29.125 6 Z M 2.875 8 L 29.125 8 C 29.640625 8 30 8.382813 30 8.8125 L 30 23.1875 C 30 23.617188 29.640625 24 29.125 24 L 2.875 24 C 2.359375 24 2 23.617188 2 23.1875 L 2 8.8125 C 2 8.382813 2.359375 8 2.875 8 Z M 5 11 L 5 21 L 8 21 L 8 14.34375 L 11 18.3125 L 14 14.34375 L 14 21 L 17 21 L 17 11 L 14 11 L 11 15 L 8 11 Z M 22 11 L 22 16 L 19 16 L 23.5 21 L 28 16 L 25 16 L 25 11 Z"
|
|
566
566
|
/>
|
|
567
567
|
</svg>
|
|
568
|
-
</
|
|
568
|
+
</ui_icon>
|
|
569
569
|
</DocumentFragment>
|
|
570
570
|
`;
|
|
571
571
|
|
|
572
572
|
exports[`primitive:<Icon> prop:value prop:value (REMOVE) 1`] = `
|
|
573
573
|
<DocumentFragment>
|
|
574
|
-
<
|
|
574
|
+
<ui_icon
|
|
575
575
|
class="icon headline-3"
|
|
576
576
|
>
|
|
577
577
|
<svg
|
|
@@ -591,13 +591,13 @@ exports[`primitive:<Icon> prop:value prop:value (REMOVE) 1`] = `
|
|
|
591
591
|
d="M19 13H5v-2h14v2z"
|
|
592
592
|
/>
|
|
593
593
|
</svg>
|
|
594
|
-
</
|
|
594
|
+
</ui_icon>
|
|
595
595
|
</DocumentFragment>
|
|
596
596
|
`;
|
|
597
597
|
|
|
598
598
|
exports[`primitive:<Icon> prop:value prop:value (RIGHT) 1`] = `
|
|
599
599
|
<DocumentFragment>
|
|
600
|
-
<
|
|
600
|
+
<ui_icon
|
|
601
601
|
class="icon headline-3"
|
|
602
602
|
>
|
|
603
603
|
<svg
|
|
@@ -617,13 +617,13 @@ exports[`primitive:<Icon> prop:value prop:value (RIGHT) 1`] = `
|
|
|
617
617
|
d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"
|
|
618
618
|
/>
|
|
619
619
|
</svg>
|
|
620
|
-
</
|
|
620
|
+
</ui_icon>
|
|
621
621
|
</DocumentFragment>
|
|
622
622
|
`;
|
|
623
623
|
|
|
624
624
|
exports[`primitive:<Icon> prop:value prop:value (SEARCH) 1`] = `
|
|
625
625
|
<DocumentFragment>
|
|
626
|
-
<
|
|
626
|
+
<ui_icon
|
|
627
627
|
class="icon headline-3"
|
|
628
628
|
>
|
|
629
629
|
<svg
|
|
@@ -643,13 +643,13 @@ exports[`primitive:<Icon> prop:value prop:value (SEARCH) 1`] = `
|
|
|
643
643
|
d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"
|
|
644
644
|
/>
|
|
645
645
|
</svg>
|
|
646
|
-
</
|
|
646
|
+
</ui_icon>
|
|
647
647
|
</DocumentFragment>
|
|
648
648
|
`;
|
|
649
649
|
|
|
650
650
|
exports[`primitive:<Icon> prop:value prop:value (SUCCESS) 1`] = `
|
|
651
651
|
<DocumentFragment>
|
|
652
|
-
<
|
|
652
|
+
<ui_icon
|
|
653
653
|
class="icon headline-3"
|
|
654
654
|
>
|
|
655
655
|
<svg
|
|
@@ -669,13 +669,13 @@ exports[`primitive:<Icon> prop:value prop:value (SUCCESS) 1`] = `
|
|
|
669
669
|
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"
|
|
670
670
|
/>
|
|
671
671
|
</svg>
|
|
672
|
-
</
|
|
672
|
+
</ui_icon>
|
|
673
673
|
</DocumentFragment>
|
|
674
674
|
`;
|
|
675
675
|
|
|
676
676
|
exports[`primitive:<Icon> prop:value prop:value (UP) 1`] = `
|
|
677
677
|
<DocumentFragment>
|
|
678
|
-
<
|
|
678
|
+
<ui_icon
|
|
679
679
|
class="icon headline-3"
|
|
680
680
|
>
|
|
681
681
|
<svg
|
|
@@ -695,13 +695,13 @@ exports[`primitive:<Icon> prop:value prop:value (UP) 1`] = `
|
|
|
695
695
|
d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"
|
|
696
696
|
/>
|
|
697
697
|
</svg>
|
|
698
|
-
</
|
|
698
|
+
</ui_icon>
|
|
699
699
|
</DocumentFragment>
|
|
700
700
|
`;
|
|
701
701
|
|
|
702
702
|
exports[`primitive:<Icon> prop:value prop:value (WARNING) 1`] = `
|
|
703
703
|
<DocumentFragment>
|
|
704
|
-
<
|
|
704
|
+
<ui_icon
|
|
705
705
|
class="icon headline-3"
|
|
706
706
|
>
|
|
707
707
|
<svg
|
|
@@ -717,13 +717,13 @@ exports[`primitive:<Icon> prop:value prop:value (WARNING) 1`] = `
|
|
|
717
717
|
d="M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
|
|
718
718
|
/>
|
|
719
719
|
</svg>
|
|
720
|
-
</
|
|
720
|
+
</ui_icon>
|
|
721
721
|
</DocumentFragment>
|
|
722
722
|
`;
|
|
723
723
|
|
|
724
724
|
exports[`primitive:<Icon> renders 1`] = `
|
|
725
725
|
<DocumentFragment>
|
|
726
|
-
<
|
|
726
|
+
<ui_icon
|
|
727
727
|
class="icon headline-3"
|
|
728
728
|
>
|
|
729
729
|
<svg
|
|
@@ -743,13 +743,13 @@ exports[`primitive:<Icon> renders 1`] = `
|
|
|
743
743
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
744
744
|
/>
|
|
745
745
|
</svg>
|
|
746
|
-
</
|
|
746
|
+
</ui_icon>
|
|
747
747
|
</DocumentFragment>
|
|
748
748
|
`;
|
|
749
749
|
|
|
750
750
|
exports[`primitive:<Icon> testId 1`] = `
|
|
751
751
|
<DocumentFragment>
|
|
752
|
-
<
|
|
752
|
+
<ui_icon
|
|
753
753
|
class="icon headline-3"
|
|
754
754
|
data-testid="mirai"
|
|
755
755
|
>
|
|
@@ -770,6 +770,6 @@ exports[`primitive:<Icon> testId 1`] = `
|
|
|
770
770
|
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
|
|
771
771
|
/>
|
|
772
772
|
</svg>
|
|
773
|
-
</
|
|
773
|
+
</ui_icon>
|
|
774
774
|
</DocumentFragment>
|
|
775
775
|
`;
|
|
@@ -10,7 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _helpers = require("../../helpers");
|
|
11
11
|
var _Primitive = require("../Primitive");
|
|
12
12
|
var _helpers2 = require("./helpers");
|
|
13
|
-
var
|
|
13
|
+
var style = _interopRequireWildcard(require("./Input.module.css"));
|
|
14
14
|
var _excluded = ["autoResize", "disabled", "multiLine", "type", "onChange", "onEnter", "onError", "onLeave"];
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -86,7 +86,7 @@ var Input = function Input(_ref) {
|
|
|
86
86
|
onFocus: onEnter,
|
|
87
87
|
onBlur: onLeave
|
|
88
88
|
} : {}), {}, {
|
|
89
|
-
className: (0, _helpers.styles)(
|
|
89
|
+
className: (0, _helpers.styles)(style.input, autoResize && multiLine && style.autoResize, others.className)
|
|
90
90
|
}));
|
|
91
91
|
};
|
|
92
92
|
exports.Input = Input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","names":["Input","autoResize","disabled","multiLine","type","onChange","onEnter","onError","onLeave","others","ref","useRef","useState","height","setHeight","useEffect","errors","getInputErrors","current","clientHeight","resize","value","handleChange","next","event","isNaN","parseValue","style","scrollHeight","React","createElement","Primitive","undefined","role","tag","test","target","onFocus","onBlur","className","styles","input","displayName","propTypes","PropTypes","bool","name","string","isRequired","func"],"sources":["../../../src/primitives/Input/Input.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { getInputErrors, styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport { parseValue } from './helpers';\nimport style from './Input.module.css';\n\nconst Input = ({ autoResize, disabled, multiLine, type = 'text', onChange, onEnter, onError, onLeave, ...others }) => {\n const ref = useRef(null);\n\n const [height, setHeight] = useState();\n\n useEffect(() => {\n const errors = getInputErrors({ ...others, type });\n if (errors && onError) onError(errors);\n\n if (autoResize && multiLine) {\n setHeight(ref.current.clientHeight);\n resize(others.value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleChange = (next = '', event) => {\n if (type === 'number' && isNaN(next)) return;\n const value = parseValue(next, type, others);\n\n onError && onError(getInputErrors({ ...others, type, value }));\n onChange && onChange(value || '', event);\n if (autoResize && multiLine) resize(value);\n };\n\n const resize = (value) => {\n if (!ref?.current) return;\n ref.current.style.height = `${value ? ref.current.scrollHeight : height}px`;\n };\n\n return React.createElement(Primitive, {\n ...others,\n disabled,\n ref: autoResize ? ref : undefined,\n role: others.role || 'input',\n tag: multiLine ? 'textarea' : 'input',\n test: undefined,\n type: !multiLine ? type : undefined,\n value: others.value || '',\n ...(!disabled\n ? {\n onChange: (event) => handleChange(event.target.value, event),\n onFocus: onEnter,\n onBlur: onLeave,\n }\n : {}),\n className: styles(style.input, autoResize && multiLine && style.autoResize, others.className),\n });\n};\n\nInput.displayName = 'Primitive:Input';\n\nInput.propTypes = {\n autoResize: PropTypes.bool,\n disabled: PropTypes.bool,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n type: PropTypes.string,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onError: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { Input };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"Input.js","names":["Input","autoResize","disabled","multiLine","type","onChange","onEnter","onError","onLeave","others","ref","useRef","useState","height","setHeight","useEffect","errors","getInputErrors","current","clientHeight","resize","value","handleChange","next","event","isNaN","parseValue","style","scrollHeight","React","createElement","Primitive","undefined","role","tag","test","target","onFocus","onBlur","className","styles","input","displayName","propTypes","PropTypes","bool","name","string","isRequired","func"],"sources":["../../../src/primitives/Input/Input.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { getInputErrors, styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport { parseValue } from './helpers';\nimport * as style from './Input.module.css';\n\nconst Input = ({ autoResize, disabled, multiLine, type = 'text', onChange, onEnter, onError, onLeave, ...others }) => {\n const ref = useRef(null);\n\n const [height, setHeight] = useState();\n\n useEffect(() => {\n const errors = getInputErrors({ ...others, type });\n if (errors && onError) onError(errors);\n\n if (autoResize && multiLine) {\n setHeight(ref.current.clientHeight);\n resize(others.value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleChange = (next = '', event) => {\n if (type === 'number' && isNaN(next)) return;\n const value = parseValue(next, type, others);\n\n onError && onError(getInputErrors({ ...others, type, value }));\n onChange && onChange(value || '', event);\n if (autoResize && multiLine) resize(value);\n };\n\n const resize = (value) => {\n if (!ref?.current) return;\n ref.current.style.height = `${value ? ref.current.scrollHeight : height}px`;\n };\n\n return React.createElement(Primitive, {\n ...others,\n disabled,\n ref: autoResize ? ref : undefined,\n role: others.role || 'input',\n tag: multiLine ? 'textarea' : 'input',\n test: undefined,\n type: !multiLine ? type : undefined,\n value: others.value || '',\n ...(!disabled\n ? {\n onChange: (event) => handleChange(event.target.value, event),\n onFocus: onEnter,\n onBlur: onLeave,\n }\n : {}),\n className: styles(style.input, autoResize && multiLine && style.autoResize, others.className),\n });\n};\n\nInput.displayName = 'Primitive:Input';\n\nInput.propTypes = {\n autoResize: PropTypes.bool,\n disabled: PropTypes.bool,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n type: PropTypes.string,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onError: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { Input };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE5C,IAAMA,KAAK,GAAG,SAARA,KAAK,OAA2G;EAAA,IAArGC,UAAU,QAAVA,UAAU;IAAEC,QAAQ,QAARA,QAAQ;IAAEC,SAAS,QAATA,SAAS;IAAA,iBAAEC,IAAI;IAAJA,IAAI,0BAAG,MAAM;IAAEC,QAAQ,QAARA,QAAQ;IAAEC,OAAO,QAAPA,OAAO;IAAEC,OAAO,QAAPA,OAAO;IAAEC,OAAO,QAAPA,OAAO;IAAKC,MAAM;EAC7G,IAAMC,GAAG,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAExB,gBAA4B,IAAAC,eAAQ,GAAE;IAAA;IAA/BC,MAAM;IAAEC,SAAS;EAExB,IAAAC,gBAAS,EAAC,YAAM;IACd,IAAMC,MAAM,GAAG,IAAAC,uBAAc,kCAAMR,MAAM;MA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AAExB,MAAM,CAACwB,IAAI,IAAI,OAAO;IAC5BC,GAAG,EAAE/B,SAAS,GAAG,UAAU,GAAG,OAAO;IACrCgC,IAAI,EAAEH,SAAS;IACf5B,IAAI,EAAE,CAACD,SAAS,GAAGC,IAAI,GAAG4B,SAAS;IACnCX,KAAK,EAAEZ,MAAM,CAACY,KAAK,IAAI;EAAE,GACrB,CAACnB,QAAQ,GACT;IACEG,QAAQ,EAAE,kBAACmB,KAAK;MAAA,OAAKF,YAAY,CAACE,KAAK,CAACY,MAAM,CAACf,KAAK,EAAEG,KAAK,CAAC;IAAA;IAC5Da,OAAO,EAAE/B,OAAO;IAChBgC,MAAM,EAAE9B;EACV,CAAC,GACD,CAAC,CAAC;IACN+B,SAAS,EAAE,IAAAC,eAAM,EAACb,KAAK,CAACc,KAAK,EAAExC,UAAU,IAAIE,SAAS,IAAIwB,KAAK,CAAC1B,UAAU,EAAEQ,MAAM,CAAC8B,SAAS;EAAC,GAC7F;AACJ,CAAC;AAAC;AAEFvC,KAAK,CAAC0C,WAAW,GAAG,iBAAiB;AAErC1C,KAAK,CAAC2C,SAAS,GAAG;EAChB1C,UAAU,EAAE2C,kBAAS,CAACC,IAAI;EAC1B3C,QAAQ,EAAE0C,kBAAS,CAACC,IAAI;EACxB1C,SAAS,EAAEyC,kBAAS,CAACC,IAAI;EACzBC,IAAI,EAAEF,kBAAS,CAACG,MAAM,CAACC,UAAU;EACjC5C,IAAI,EAAEwC,kBAAS,CAACG,MAAM;EACtB1C,QAAQ,EAAEuC,kBAAS,CAACK,IAAI;EACxB3C,OAAO,EAAEsC,kBAAS,CAACK,IAAI;EACvB1C,OAAO,EAAEqC,kBAAS,CAACK,IAAI;EACvBzC,OAAO,EAAEoC,kBAAS,CAACK;AACrB,CAAC"}
|
|
@@ -11,7 +11,7 @@ var _helpers = require("../../helpers");
|
|
|
11
11
|
var _hooks = require("../../hooks");
|
|
12
12
|
var _Primitive = require("../Primitive");
|
|
13
13
|
var _helpers2 = require("./helpers");
|
|
14
|
-
var
|
|
14
|
+
var style = _interopRequireWildcard(require("./Layer.module.css"));
|
|
15
15
|
var _LayerContent = require("./LayerContent");
|
|
16
16
|
var _excluded = ["bottom", "centered", "fixed", "forceRender", "left", "right", "top", "timestamp", "visible", "onPosition"];
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -106,7 +106,7 @@ var Layer = function Layer(_ref) {
|
|
|
106
106
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
107
107
|
ref: componentRef,
|
|
108
108
|
role: others.role || 'layer',
|
|
109
|
-
tag: "
|
|
109
|
+
tag: "layer",
|
|
110
110
|
testId: others.testId
|
|
111
111
|
}, children.find(function (_ref2) {
|
|
112
112
|
var name = _ref2.type.name;
|
|
@@ -114,7 +114,8 @@ var Layer = function Layer(_ref) {
|
|
|
114
114
|
})), (forceRender || visible) && /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
115
115
|
ref: contentRef,
|
|
116
116
|
role: others.role ? "".concat(others.role, "-content") : 'layer-content',
|
|
117
|
-
|
|
117
|
+
tag: "layer_content",
|
|
118
|
+
className: (0, _helpers.styles)(style.layer, fixed && style.fixed, !visible && style.hidden),
|
|
118
119
|
style: _objectSpread({}, position)
|
|
119
120
|
}, /*#__PURE__*/_react.default.createElement(createWrapper ? 'div' : _react.default.Fragment, createWrapper ? {
|
|
120
121
|
className: className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layer.js","names":["Layer","forceBottom","bottom","centered","fixed","forceRender","forceLeft","left","forceRight","right","forceTop","top","timestamp","visible","onPosition","others","device","useDevice","componentRef","useRef","contentRef","useState","position","setPosition","useLayoutEffect","content","current","ResizeObserver","observer","calcPosition","observe","unobserve","componentEl","firstChild","contentEl","componentLayout","getElementLayout","scrollTop","getScrollParent","contentLayout","modal","getModalParent","getLayerPosition","orientation","children","React","Children","map","child","className","contentStyle","style","createWrapper","role","testId","find","name","type","LayerContent","styles","layer","hidden","createElement","Fragment","undefined","propTypes","PropTypes","bool","node","number","func"],"sources":["../../../src/primitives/Layer/Layer.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Primitive } from '../Primitive';\nimport { getElementLayout, getLayerPosition, getModalParent, getScrollParent } from './helpers';\nimport style from './Layer.module.css';\nimport { LayerContent } from './LayerContent';\n\nconst Layer = ({\n bottom: forceBottom,\n centered,\n fixed,\n forceRender = true,\n left: forceLeft,\n right: forceRight,\n top: forceTop,\n timestamp,\n visible,\n onPosition = () => {},\n ...others\n}) => {\n const device = useDevice();\n const componentRef = useRef();\n const contentRef = useRef();\n\n const [position, setPosition] = useState();\n\n useLayoutEffect(() => {\n const content = contentRef?.current;\n if (!content || typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(calcPosition);\n observer.observe(content);\n\n return () => observer.unobserve(content);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useLayoutEffect(\n () => calcPosition(),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [centered, device, forceBottom, forceLeft, forceRight, forceTop, timestamp, visible],\n );\n\n const calcPosition = () => {\n const { current: { firstChild: componentEl } = {} } = componentRef;\n const { current: contentEl } = contentRef;\n\n if (!componentEl || !contentEl) return setPosition();\n\n const componentLayout = { ...getElementLayout(componentEl), scrollTop: getScrollParent(componentEl)?.scrollTop };\n const contentLayout = getElementLayout(contentEl);\n const modal = getModalParent(componentEl);\n const {\n left = 0,\n top = 0,\n orientation = {},\n } = getLayerPosition(componentLayout, contentLayout, device, modal, {\n centered,\n forceBottom,\n forceLeft,\n forceRight,\n forceTop,\n });\n\n setPosition({ left: `${left}px`, top: `${top}px` });\n onPosition(orientation);\n };\n\n const children = React.Children.map(others.children || [], (child) => child);\n const { className, style: contentStyle } = others;\n const createWrapper = className || contentStyle;\n\n return (\n <>\n <Primitive ref={componentRef} role={others.role || 'layer'} tag=\"
|
|
1
|
+
{"version":3,"file":"Layer.js","names":["Layer","forceBottom","bottom","centered","fixed","forceRender","forceLeft","left","forceRight","right","forceTop","top","timestamp","visible","onPosition","others","device","useDevice","componentRef","useRef","contentRef","useState","position","setPosition","useLayoutEffect","content","current","ResizeObserver","observer","calcPosition","observe","unobserve","componentEl","firstChild","contentEl","componentLayout","getElementLayout","scrollTop","getScrollParent","contentLayout","modal","getModalParent","getLayerPosition","orientation","children","React","Children","map","child","className","contentStyle","style","createWrapper","role","testId","find","name","type","LayerContent","styles","layer","hidden","createElement","Fragment","undefined","propTypes","PropTypes","bool","node","number","func"],"sources":["../../../src/primitives/Layer/Layer.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Primitive } from '../Primitive';\nimport { getElementLayout, getLayerPosition, getModalParent, getScrollParent } from './helpers';\nimport * as style from './Layer.module.css';\nimport { LayerContent } from './LayerContent';\n\nconst Layer = ({\n bottom: forceBottom,\n centered,\n fixed,\n forceRender = true,\n left: forceLeft,\n right: forceRight,\n top: forceTop,\n timestamp,\n visible,\n onPosition = () => {},\n ...others\n}) => {\n const device = useDevice();\n const componentRef = useRef();\n const contentRef = useRef();\n\n const [position, setPosition] = useState();\n\n useLayoutEffect(() => {\n const content = contentRef?.current;\n if (!content || typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(calcPosition);\n observer.observe(content);\n\n return () => observer.unobserve(content);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useLayoutEffect(\n () => calcPosition(),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [centered, device, forceBottom, forceLeft, forceRight, forceTop, timestamp, visible],\n );\n\n const calcPosition = () => {\n const { current: { firstChild: componentEl } = {} } = componentRef;\n const { current: contentEl } = contentRef;\n\n if (!componentEl || !contentEl) return setPosition();\n\n const componentLayout = { ...getElementLayout(componentEl), scrollTop: getScrollParent(componentEl)?.scrollTop };\n const contentLayout = getElementLayout(contentEl);\n const modal = getModalParent(componentEl);\n const {\n left = 0,\n top = 0,\n orientation = {},\n } = getLayerPosition(componentLayout, contentLayout, device, modal, {\n centered,\n forceBottom,\n forceLeft,\n forceRight,\n forceTop,\n });\n\n setPosition({ left: `${left}px`, top: `${top}px` });\n onPosition(orientation);\n };\n\n const children = React.Children.map(others.children || [], (child) => child);\n const { className, style: contentStyle } = others;\n const createWrapper = className || contentStyle;\n\n return (\n <>\n <Primitive ref={componentRef} role={others.role || 'layer'} tag=\"layer\" testId={others.testId}>\n {children.find(({ type: { name } }) => name !== LayerContent.name)}\n </Primitive>\n\n {(forceRender || visible) && (\n <Primitive\n ref={contentRef}\n role={others.role ? `${others.role}-content` : 'layer-content'}\n tag=\"layer_content\"\n className={styles(style.layer, fixed && style.fixed, !visible && style.hidden)}\n style={{ ...position }}\n >\n {React.createElement(\n createWrapper ? 'div' : React.Fragment,\n createWrapper ? { className, style: contentStyle } : undefined,\n children?.find(({ type: { name } }) => name === LayerContent.name),\n )}\n </Primitive>\n )}\n </>\n );\n};\n\nLayer.propTypes = {\n bottom: PropTypes.bool,\n centered: PropTypes.bool,\n children: PropTypes.node,\n fixed: PropTypes.bool,\n forceRender: PropTypes.bool,\n left: PropTypes.bool,\n right: PropTypes.bool,\n timestamp: PropTypes.number,\n top: PropTypes.bool,\n visible: PropTypes.bool,\n onPosition: PropTypes.func,\n};\n\nexport { Layer };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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