@mirai/ui 1.1.16 → 2.0.2
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 +2 -5
- package/build/components/Action/Action.js.map +1 -1
- package/build/components/Action/Action.stories.js +1 -1
- package/build/components/Action/Action.stories.js.map +1 -1
- package/build/components/Action/__tests__/__snapshots__/Action.test.js.snap +42 -30
- package/build/components/Button/Button.js +4 -6
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Button/__tests__/__snapshots__/Button.test.js.snap +38 -27
- package/build/components/Calendar/Calendar.js +1 -1
- package/build/components/Calendar/Calendar.js.map +1 -1
- package/build/components/Calendar/Calendar.module.css +5 -5
- package/build/components/Calendar/__tests__/__snapshots__/Calendar.test.jsx.snap +15608 -15576
- package/build/components/Form/Form.js +2 -5
- package/build/components/Form/Form.js.map +1 -1
- package/build/components/Form/__tests__/__snapshots__/Form.test.jsx.snap +14 -12
- package/build/components/InputDate/InputDate.js +1 -0
- package/build/components/InputDate/InputDate.js.map +1 -1
- package/build/components/InputDate/__tests__/__snapshots__/InputDate.test.js.snap +67 -42
- package/build/components/InputNumber/InputNumber.js +17 -4
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +198 -114
- package/build/components/InputOption/InputOption.js +6 -2
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputOption/__tests__/__snapshots__/InputOption.test.js.snap +114 -75
- package/build/components/InputPhone/InputPhone.js +8 -1
- package/build/components/InputPhone/InputPhone.js.map +1 -1
- package/build/components/InputPhone/InputPhone.module.css +1 -1
- package/build/components/InputPhone/__tests__/__snapshots__/InputPhone.test.js.snap +448 -354
- package/build/components/InputSelect/InputSelect.js +10 -1
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +118 -112
- package/build/components/InputText/InputText.js +6 -2
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +160 -130
- package/build/components/InputText/partials/InputText.Label.js +1 -0
- package/build/components/InputText/partials/InputText.Label.js.map +1 -1
- package/build/components/Menu/Menu.js +1 -0
- package/build/components/Menu/Menu.js.map +1 -1
- package/build/components/Menu/__tests__/__snapshots__/Menu.test.jsx.snap +76 -55
- package/build/components/Modal/Modal.js +28 -10
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +106 -72
- package/build/components/Notification/Notification.js +1 -0
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +328 -288
- package/build/components/Progress/Progress.js +1 -0
- package/build/components/Progress/Progress.js.map +1 -1
- package/build/components/Progress/__tests__/__snapshots__/Progress.test.jsx.snap +31 -18
- package/build/components/Slider/Slider.js +3 -2
- package/build/components/Slider/Slider.js.map +1 -1
- package/build/components/Slider/Slider.module.css +1 -1
- package/build/components/Slider/__tests__/__snapshots__/Slider.test.js.snap +485 -349
- package/build/components/Table/Table.js +2 -4
- package/build/components/Table/Table.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 +890 -444
- package/build/components/Tooltip/Tooltip.js +3 -4
- package/build/components/Tooltip/Tooltip.js.map +1 -1
- package/build/components/Tooltip/__tests__/__snapshots__/Tooltip.test.jsx.snap +38 -28
- package/build/primitives/Checkbox/Checkbox.js +1 -0
- package/build/primitives/Checkbox/Checkbox.js.map +1 -1
- package/build/primitives/Checkbox/__tests__/__snapshots__/Checkbox.test.js.snap +35 -20
- package/build/primitives/Icon/Icon.js +1 -1
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +108 -82
- package/build/primitives/Layer/Layer.js +2 -1
- package/build/primitives/Layer/Layer.js.map +1 -1
- package/build/primitives/Layer/__tests__/__snapshots__/Layer.test.js.snap +60 -42
- 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 +7 -6
- package/build/primitives/Pressable/Pressable.js.map +1 -1
- package/build/primitives/Pressable/__tests__/__snapshots__/Pressable.test.js.snap +16 -12
- package/build/primitives/Primitive/Primitive.constants.js +1 -1
- package/build/primitives/Primitive/Primitive.constants.js.map +1 -1
- package/build/primitives/Primitive/Primitive.js +2 -2
- package/build/primitives/Primitive/Primitive.js.map +1 -1
- package/build/primitives/Primitive/__tests__/__snapshots__/Primitive.test.js.snap +12 -12
- package/build/primitives/Primitive/helpers/getTag.js +35 -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 +1 -1
- package/build/primitives/Radio/Radio.js.map +1 -1
- package/build/primitives/Radio/__tests__/__snapshots__/Radio.test.js.snap +39 -21
- package/build/primitives/ScrollView/ScrollView.js +79 -30
- package/build/primitives/ScrollView/ScrollView.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.module.css +53 -7
- package/build/primitives/ScrollView/ScrollView.stories.js +7 -6
- package/build/primitives/ScrollView/ScrollView.stories.js.map +1 -1
- package/build/primitives/ScrollView/__tests__/__snapshots__/ScrollView.test.js.snap +33 -33
- package/build/primitives/Select/Select.js +7 -4
- package/build/primitives/Select/Select.js.map +1 -1
- package/build/primitives/Select/__tests__/__snapshots__/Select.test.js.snap +35 -0
- package/build/primitives/Switch/Switch.js +1 -1
- package/build/primitives/Switch/Switch.js.map +1 -1
- package/build/primitives/Switch/__tests__/__snapshots__/Switch.test.js.snap +60 -40
- package/build/primitives/Text/Text.js +4 -3
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/__tests__/__snapshots__/Text.test.js.snap +68 -68
- package/build/primitives/Text/helpers/parseMarkdown.js +3 -1
- package/build/primitives/Text/helpers/parseMarkdown.js.map +1 -1
- package/build/primitives/View/View.js +2 -5
- package/build/primitives/View/View.js.map +1 -1
- package/build/primitives/View/__tests__/__snapshots__/View.test.js.snap +15 -15
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`primitive:<ScrollView> inherit:className 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
6
|
-
class="scrollview snap vertical
|
|
5
|
+
<ui_scrollview
|
|
6
|
+
class="scrollview snap vertical mirai"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
style="height: 128px; width: 128px;"
|
|
@@ -55,14 +55,14 @@ exports[`primitive:<ScrollView> inherit:className 1`] = `
|
|
|
55
55
|
>
|
|
56
56
|
10
|
|
57
57
|
</div>
|
|
58
|
-
</
|
|
58
|
+
</ui_scrollview>
|
|
59
59
|
</DocumentFragment>
|
|
60
60
|
`;
|
|
61
61
|
|
|
62
62
|
exports[`primitive:<ScrollView> prop:height 1`] = `
|
|
63
63
|
<DocumentFragment>
|
|
64
|
-
<
|
|
65
|
-
class="scrollview snap vertical
|
|
64
|
+
<ui_scrollview
|
|
65
|
+
class="scrollview snap vertical"
|
|
66
66
|
style="height: 256px;"
|
|
67
67
|
>
|
|
68
68
|
<div
|
|
@@ -115,14 +115,14 @@ exports[`primitive:<ScrollView> prop:height 1`] = `
|
|
|
115
115
|
>
|
|
116
116
|
10
|
|
117
117
|
</div>
|
|
118
|
-
</
|
|
118
|
+
</ui_scrollview>
|
|
119
119
|
</DocumentFragment>
|
|
120
120
|
`;
|
|
121
121
|
|
|
122
122
|
exports[`primitive:<ScrollView> prop:horizontal 1`] = `
|
|
123
123
|
<DocumentFragment>
|
|
124
|
-
<
|
|
125
|
-
class="scrollview snap horizontal
|
|
124
|
+
<ui_scrollview
|
|
125
|
+
class="scrollview snap horizontal"
|
|
126
126
|
>
|
|
127
127
|
<div
|
|
128
128
|
style="height: 128px; width: 128px;"
|
|
@@ -174,13 +174,13 @@ exports[`primitive:<ScrollView> prop:horizontal 1`] = `
|
|
|
174
174
|
>
|
|
175
175
|
10
|
|
176
176
|
</div>
|
|
177
|
-
</
|
|
177
|
+
</ui_scrollview>
|
|
178
178
|
</DocumentFragment>
|
|
179
179
|
`;
|
|
180
180
|
|
|
181
181
|
exports[`primitive:<ScrollView> prop:scrollIndicator 1`] = `
|
|
182
182
|
<DocumentFragment>
|
|
183
|
-
<
|
|
183
|
+
<ui_scrollview
|
|
184
184
|
class="scrollview snap vertical"
|
|
185
185
|
>
|
|
186
186
|
<div
|
|
@@ -233,14 +233,14 @@ exports[`primitive:<ScrollView> prop:scrollIndicator 1`] = `
|
|
|
233
233
|
>
|
|
234
234
|
10
|
|
235
235
|
</div>
|
|
236
|
-
</
|
|
236
|
+
</ui_scrollview>
|
|
237
237
|
</DocumentFragment>
|
|
238
238
|
`;
|
|
239
239
|
|
|
240
240
|
exports[`primitive:<ScrollView> prop:scrollto 1`] = `
|
|
241
241
|
<DocumentFragment>
|
|
242
|
-
<
|
|
243
|
-
class="scrollview snap vertical
|
|
242
|
+
<ui_scrollview
|
|
243
|
+
class="scrollview snap vertical"
|
|
244
244
|
>
|
|
245
245
|
<div
|
|
246
246
|
style="height: 128px; width: 128px;"
|
|
@@ -292,14 +292,14 @@ exports[`primitive:<ScrollView> prop:scrollto 1`] = `
|
|
|
292
292
|
>
|
|
293
293
|
10
|
|
294
294
|
</div>
|
|
295
|
-
</
|
|
295
|
+
</ui_scrollview>
|
|
296
296
|
</DocumentFragment>
|
|
297
297
|
`;
|
|
298
298
|
|
|
299
299
|
exports[`primitive:<ScrollView> prop:snap 1`] = `
|
|
300
300
|
<DocumentFragment>
|
|
301
|
-
<
|
|
302
|
-
class="scrollview vertical
|
|
301
|
+
<ui_scrollview
|
|
302
|
+
class="scrollview vertical"
|
|
303
303
|
>
|
|
304
304
|
<div
|
|
305
305
|
style="height: 128px; width: 128px;"
|
|
@@ -351,14 +351,15 @@ exports[`primitive:<ScrollView> prop:snap 1`] = `
|
|
|
351
351
|
>
|
|
352
352
|
10
|
|
353
353
|
</div>
|
|
354
|
-
</
|
|
354
|
+
</ui_scrollview>
|
|
355
355
|
</DocumentFragment>
|
|
356
356
|
`;
|
|
357
357
|
|
|
358
|
-
exports[`primitive:<ScrollView> prop:
|
|
358
|
+
exports[`primitive:<ScrollView> prop:width 1`] = `
|
|
359
359
|
<DocumentFragment>
|
|
360
|
-
<
|
|
361
|
-
class="scrollview snap vertical
|
|
360
|
+
<ui_scrollview
|
|
361
|
+
class="scrollview snap vertical"
|
|
362
|
+
style="width: 256px;"
|
|
362
363
|
>
|
|
363
364
|
<div
|
|
364
365
|
style="height: 128px; width: 128px;"
|
|
@@ -410,15 +411,14 @@ exports[`primitive:<ScrollView> prop:tag 1`] = `
|
|
|
410
411
|
>
|
|
411
412
|
10
|
|
412
413
|
</div>
|
|
413
|
-
</
|
|
414
|
+
</ui_scrollview>
|
|
414
415
|
</DocumentFragment>
|
|
415
416
|
`;
|
|
416
417
|
|
|
417
|
-
exports[`primitive:<ScrollView>
|
|
418
|
+
exports[`primitive:<ScrollView> renders 1`] = `
|
|
418
419
|
<DocumentFragment>
|
|
419
|
-
<
|
|
420
|
-
class="scrollview snap vertical
|
|
421
|
-
style="width: 256px;"
|
|
420
|
+
<ui_scrollview
|
|
421
|
+
class="scrollview snap vertical"
|
|
422
422
|
>
|
|
423
423
|
<div
|
|
424
424
|
style="height: 128px; width: 128px;"
|
|
@@ -470,14 +470,14 @@ exports[`primitive:<ScrollView> prop:width 1`] = `
|
|
|
470
470
|
>
|
|
471
471
|
10
|
|
472
472
|
</div>
|
|
473
|
-
</
|
|
473
|
+
</ui_scrollview>
|
|
474
474
|
</DocumentFragment>
|
|
475
475
|
`;
|
|
476
476
|
|
|
477
|
-
exports[`primitive:<ScrollView>
|
|
477
|
+
exports[`primitive:<ScrollView> tag 1`] = `
|
|
478
478
|
<DocumentFragment>
|
|
479
|
-
<
|
|
480
|
-
class="scrollview snap vertical
|
|
479
|
+
<ui_tag
|
|
480
|
+
class="scrollview snap vertical"
|
|
481
481
|
>
|
|
482
482
|
<div
|
|
483
483
|
style="height: 128px; width: 128px;"
|
|
@@ -529,14 +529,14 @@ exports[`primitive:<ScrollView> renders 1`] = `
|
|
|
529
529
|
>
|
|
530
530
|
10
|
|
531
531
|
</div>
|
|
532
|
-
</
|
|
532
|
+
</ui_tag>
|
|
533
533
|
</DocumentFragment>
|
|
534
534
|
`;
|
|
535
535
|
|
|
536
536
|
exports[`primitive:<ScrollView> testId 1`] = `
|
|
537
537
|
<DocumentFragment>
|
|
538
|
-
<
|
|
539
|
-
class="scrollview snap vertical
|
|
538
|
+
<ui_scrollview
|
|
539
|
+
class="scrollview snap vertical"
|
|
540
540
|
data-testid="mirai"
|
|
541
541
|
>
|
|
542
542
|
<div
|
|
@@ -589,6 +589,6 @@ exports[`primitive:<ScrollView> testId 1`] = `
|
|
|
589
589
|
>
|
|
590
590
|
10
|
|
591
591
|
</div>
|
|
592
|
-
</
|
|
592
|
+
</ui_scrollview>
|
|
593
593
|
</DocumentFragment>
|
|
594
594
|
`;
|
|
@@ -51,7 +51,7 @@ var Select = function Select(_ref) {
|
|
|
51
51
|
return /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, _objectSpread(_objectSpread(_objectSpread({}, others), {}, {
|
|
52
52
|
disabled: disabled,
|
|
53
53
|
role: others.role || 'select',
|
|
54
|
-
tag: 'select',
|
|
54
|
+
tag: others.tag || 'select',
|
|
55
55
|
value: value
|
|
56
56
|
}, !disabled ? {
|
|
57
57
|
onChange: function onChange(event) {
|
|
@@ -60,16 +60,19 @@ var Select = function Select(_ref) {
|
|
|
60
60
|
onFocus: onEnter,
|
|
61
61
|
onBlur: onLeave
|
|
62
62
|
} : {}), {}, {
|
|
63
|
-
className: (0, _helpers.styles)(_SelectModule.default.select, value === EMPTY && _SelectModule.default.empty, others.className)
|
|
63
|
+
className: (0, _helpers.styles)(_SelectModule.default.select, value === EMPTY && _SelectModule.default.empty, others.className),
|
|
64
|
+
'aria-label': others['aria-label'] || value
|
|
64
65
|
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, emptyOption && /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
65
66
|
tag: "option",
|
|
66
|
-
value: EMPTY
|
|
67
|
+
value: EMPTY,
|
|
68
|
+
"aria-label": emptyOption
|
|
67
69
|
}, emptyOption), options.map(function (option, index) {
|
|
68
70
|
return /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
69
71
|
tag: "option",
|
|
70
72
|
disabled: disabledOptions[index],
|
|
71
73
|
key: option,
|
|
72
|
-
value: values[index] || option
|
|
74
|
+
value: values[index] || option,
|
|
75
|
+
"aria-label": option
|
|
73
76
|
}, option);
|
|
74
77
|
})));
|
|
75
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","names":["EMPTY","Select","disabled","disabledOptions","emptyOption","options","value","values","onChange","onEnter","onError","onLeave","others","useEffect","errors","getInputErrors","handleChange","event","React","createElement","Primitive","role","tag","target","onFocus","onBlur","className","styles","style","select","empty","map","option","index","displayName","propTypes","PropTypes","bool","arrayOf","string","name","isRequired","oneOfType","number","func"],"sources":["../../../src/primitives/Select/Select.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect } from 'react';\n\nimport { getInputErrors, styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport style from './Select.module.css';\n\nconst EMPTY = '';\n\nconst Select = ({\n disabled,\n disabledOptions = [],\n emptyOption,\n options = [],\n value,\n values = [],\n onChange,\n onEnter,\n onError,\n onLeave,\n ...others\n}) => {\n useEffect(() => {\n const errors = getInputErrors({ ...others });\n if (errors && onError) onError(errors);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleChange = (value, event) => {\n onError && onError(getInputErrors({ ...others, value }));\n onChange && onChange(value, event);\n };\n\n return React.createElement(\n Primitive,\n {\n ...others,\n disabled,\n role: others.role || 'select',\n tag: 'select',\n value,\n ...(!disabled\n ? {\n onChange: (event) => handleChange(event.target.value, event),\n onFocus: onEnter,\n onBlur: onLeave,\n }\n : {}),\n className: styles(style.select, value === EMPTY && style.empty, others.className),\n },\n <>\n {emptyOption && (\n <Primitive tag=\"option\" value={EMPTY}>\n {emptyOption}\n </Primitive>\n )}\n {options.map((option, index) => (\n <Primitive
|
|
1
|
+
{"version":3,"file":"Select.js","names":["EMPTY","Select","disabled","disabledOptions","emptyOption","options","value","values","onChange","onEnter","onError","onLeave","others","useEffect","errors","getInputErrors","handleChange","event","React","createElement","Primitive","role","tag","target","onFocus","onBlur","className","styles","style","select","empty","map","option","index","displayName","propTypes","PropTypes","bool","arrayOf","string","name","isRequired","oneOfType","number","func"],"sources":["../../../src/primitives/Select/Select.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect } from 'react';\n\nimport { getInputErrors, styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport style from './Select.module.css';\n\nconst EMPTY = '';\n\nconst Select = ({\n disabled,\n disabledOptions = [],\n emptyOption,\n options = [],\n value,\n values = [],\n onChange,\n onEnter,\n onError,\n onLeave,\n ...others\n}) => {\n useEffect(() => {\n const errors = getInputErrors({ ...others });\n if (errors && onError) onError(errors);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleChange = (value, event) => {\n onError && onError(getInputErrors({ ...others, value }));\n onChange && onChange(value, event);\n };\n\n return React.createElement(\n Primitive,\n {\n ...others,\n disabled,\n role: others.role || 'select',\n tag: others.tag || 'select',\n value,\n ...(!disabled\n ? {\n onChange: (event) => handleChange(event.target.value, event),\n onFocus: onEnter,\n onBlur: onLeave,\n }\n : {}),\n className: styles(style.select, value === EMPTY && style.empty, others.className),\n 'aria-label': others['aria-label'] || value,\n },\n <>\n {emptyOption && (\n <Primitive tag=\"option\" value={EMPTY} aria-label={emptyOption}>\n {emptyOption}\n </Primitive>\n )}\n {options.map((option, index) => (\n <Primitive\n tag=\"option\"\n disabled={disabledOptions[index]}\n key={option}\n value={values[index] || option}\n aria-label={option}\n >\n {option}\n </Primitive>\n ))}\n </>,\n );\n};\n\nSelect.displayName = 'Primitive:Select';\n\nSelect.propTypes = {\n disabled: PropTypes.bool,\n disabledOptions: PropTypes.arrayOf(PropTypes.bool),\n emptyOption: PropTypes.string,\n name: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n values: PropTypes.arrayOf(PropTypes.string),\n value: PropTypes.string,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onError: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { Select };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAExC,IAAMA,KAAK,GAAG,EAAE;AAEhB,IAAMC,MAAM,GAAG,SAATA,MAAM,OAYN;EAAA,IAXJC,QAAQ,QAARA,QAAQ;IAAA,4BACRC,eAAe;IAAfA,eAAe,qCAAG,EAAE;IACpBC,WAAW,QAAXA,WAAW;IAAA,oBACXC,OAAO;IAAPA,OAAO,6BAAG,EAAE;IACZC,KAAK,QAALA,KAAK;IAAA,mBACLC,MAAM;IAANA,MAAM,4BAAG,EAAE;IACXC,QAAQ,QAARA,QAAQ;IACRC,OAAO,QAAPA,OAAO;IACPC,OAAO,QAAPA,OAAO;IACPC,OAAO,QAAPA,OAAO;IACJC,MAAM;EAET,IAAAC,gBAAS,EAAC,YAAM;IACd,IAAMC,MAAM,GAAG,IAAAC,uBAAc,oBAAMH,MAAM,EAAG;IAC5C,IAAIE,MAAM,IAAIJ,OAAO,EAAEA,OAAO,CAACI,MAAM,CAAC;IACtC;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,IAAME,YAAY,GAAG,S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AYA;IAAO,GAElBA,MAAM,CACG;EAAA,CACb,CAAC,CACD,CACJ;AACH,CAAC;AAAC;AAEF/B,MAAM,CAACiC,WAAW,GAAG,kBAAkB;AAEvCjC,MAAM,CAACkC,SAAS,GAAG;EACjBjC,QAAQ,EAAEkC,kBAAS,CAACC,IAAI;EACxBlC,eAAe,EAAEiC,kBAAS,CAACE,OAAO,CAACF,kBAAS,CAACC,IAAI,CAAC;EAClDjC,WAAW,EAAEgC,kBAAS,CAACG,MAAM;EAC7BC,IAAI,EAAEJ,kBAAS,CAACG,MAAM,CAACE,UAAU;EACjCpC,OAAO,EAAE+B,kBAAS,CAACE,OAAO,CAACF,kBAAS,CAACM,SAAS,CAAC,CAACN,kBAAS,CAACG,MAAM,EAAEH,kBAAS,CAACO,MAAM,CAAC,CAAC,CAAC;EACrFpC,MAAM,EAAE6B,kBAAS,CAACE,OAAO,CAACF,kBAAS,CAACG,MAAM,CAAC;EAC3CjC,KAAK,EAAE8B,kBAAS,CAACG,MAAM;EACvB/B,QAAQ,EAAE4B,kBAAS,CAACQ,IAAI;EACxBnC,OAAO,EAAE2B,kBAAS,CAACQ,IAAI;EACvBlC,OAAO,EAAE0B,kBAAS,CAACQ,IAAI;EACvBjC,OAAO,EAAEyB,kBAAS,CAACQ;AACrB,CAAC"}
|
|
@@ -177,6 +177,41 @@ exports[`primitive:<Select> renders 1`] = `
|
|
|
177
177
|
</DocumentFragment>
|
|
178
178
|
`;
|
|
179
179
|
|
|
180
|
+
exports[`primitive:<Select> tag 1`] = `
|
|
181
|
+
<DocumentFragment>
|
|
182
|
+
<ui_tag
|
|
183
|
+
class="select"
|
|
184
|
+
name="name"
|
|
185
|
+
>
|
|
186
|
+
<option
|
|
187
|
+
value="one"
|
|
188
|
+
>
|
|
189
|
+
one
|
|
190
|
+
</option>
|
|
191
|
+
<option
|
|
192
|
+
value="two"
|
|
193
|
+
>
|
|
194
|
+
two
|
|
195
|
+
</option>
|
|
196
|
+
<option
|
|
197
|
+
value="three"
|
|
198
|
+
>
|
|
199
|
+
three
|
|
200
|
+
</option>
|
|
201
|
+
<option
|
|
202
|
+
value="four"
|
|
203
|
+
>
|
|
204
|
+
four
|
|
205
|
+
</option>
|
|
206
|
+
<option
|
|
207
|
+
value="five"
|
|
208
|
+
>
|
|
209
|
+
five
|
|
210
|
+
</option>
|
|
211
|
+
</ui_tag>
|
|
212
|
+
</DocumentFragment>
|
|
213
|
+
`;
|
|
214
|
+
|
|
180
215
|
exports[`primitive:<Select> testId 1`] = `
|
|
181
216
|
<DocumentFragment>
|
|
182
217
|
<select
|
|
@@ -27,6 +27,7 @@ var Switch = function Switch(_ref) {
|
|
|
27
27
|
};
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, _extends({}, others, {
|
|
29
29
|
role: others.role || 'switch',
|
|
30
|
+
tag: others.tag || 'switch',
|
|
30
31
|
onClick: !disabled ? handleChange : undefined,
|
|
31
32
|
className: (0, _helpers.styles)(_SwitchModule.default.switch, others.className)
|
|
32
33
|
}), /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
@@ -39,7 +40,6 @@ var Switch = function Switch(_ref) {
|
|
|
39
40
|
}), /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
40
41
|
className: (0, _helpers.styles)(_SwitchModule.default.area, error && !checked && !disabled && _SwitchModule.default.error)
|
|
41
42
|
}, /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, {
|
|
42
|
-
tag: "span",
|
|
43
43
|
className: _SwitchModule.default.toggle
|
|
44
44
|
})));
|
|
45
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","names":["Switch","checked","disabled","error","name","onChange","others","handleChange","event","role","undefined","styles","style","switch","className","area","toggle","displayName","propTypes","PropTypes","bool","string","isRequired","func"],"sources":["../../../src/primitives/Switch/Switch.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport style from './Switch.module.css';\n\nconst Switch = ({ checked = false, disabled, error, name, onChange, ...others }) => {\n const handleChange = (event) => {\n onChange && onChange(!checked, event);\n };\n\n return (\n <Primitive\n {...others}\n role={others.role || 'switch'}\n onClick={!disabled ? handleChange : undefined}\n className={styles(style.switch, others.className)}\n >\n <Primitive checked={checked} disabled={disabled} name={name} tag=\"input\" type=\"checkbox\" onChange={() => {}} />\n <Primitive className={styles(style.area, error && !checked && !disabled && style.error)}>\n <Primitive
|
|
1
|
+
{"version":3,"file":"Switch.js","names":["Switch","checked","disabled","error","name","onChange","others","handleChange","event","role","tag","undefined","styles","style","switch","className","area","toggle","displayName","propTypes","PropTypes","bool","string","isRequired","func"],"sources":["../../../src/primitives/Switch/Switch.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport style from './Switch.module.css';\n\nconst Switch = ({ checked = false, disabled, error, name, onChange, ...others }) => {\n const handleChange = (event) => {\n onChange && onChange(!checked, event);\n };\n\n return (\n <Primitive\n {...others}\n role={others.role || 'switch'}\n tag={others.tag || 'switch'}\n onClick={!disabled ? handleChange : undefined}\n className={styles(style.switch, others.className)}\n >\n <Primitive checked={checked} disabled={disabled} name={name} tag=\"input\" type=\"checkbox\" onChange={() => {}} />\n <Primitive className={styles(style.area, error && !checked && !disabled && style.error)}>\n <Primitive className={style.toggle} />\n </Primitive>\n </Primitive>\n );\n};\n\nSwitch.displayName = 'Primitive:Switch';\n\nSwitch.propTypes = {\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n name: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n};\n\nexport { Switch };\n"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AACA;AAAwC;AAAA;AAAA;AAAA;AAAA;AAExC,IAAMA,MAAM,GAAG,SAATA,MAAM,OAAwE;EAAA,wBAAlEC,OAAO;IAAPA,OAAO,6B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kBAAS,CAACE,MAAM,CAACC,UAAU;EACjClB,QAAQ,EAAEe,kBAAS,CAACI;AACtB,CAAC"}
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`primitive:<Switch> inherit:className 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
5
|
+
<ui_switch
|
|
6
6
|
class="switch mirai"
|
|
7
7
|
>
|
|
8
8
|
<input
|
|
9
9
|
name="name"
|
|
10
10
|
type="checkbox"
|
|
11
11
|
/>
|
|
12
|
-
<
|
|
12
|
+
<ui_primitive
|
|
13
13
|
class="area"
|
|
14
14
|
>
|
|
15
|
-
<
|
|
15
|
+
<ui_primitive
|
|
16
16
|
class="toggle"
|
|
17
17
|
/>
|
|
18
|
-
</
|
|
19
|
-
</
|
|
18
|
+
</ui_primitive>
|
|
19
|
+
</ui_switch>
|
|
20
20
|
</DocumentFragment>
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
exports[`primitive:<Switch> prop:checked && disabled 1`] = `
|
|
24
24
|
<DocumentFragment>
|
|
25
|
-
<
|
|
25
|
+
<ui_switch
|
|
26
26
|
class="switch"
|
|
27
27
|
>
|
|
28
28
|
<input
|
|
@@ -31,20 +31,20 @@ exports[`primitive:<Switch> prop:checked && disabled 1`] = `
|
|
|
31
31
|
name="name"
|
|
32
32
|
type="checkbox"
|
|
33
33
|
/>
|
|
34
|
-
<
|
|
34
|
+
<ui_primitive
|
|
35
35
|
class="area"
|
|
36
36
|
>
|
|
37
|
-
<
|
|
37
|
+
<ui_primitive
|
|
38
38
|
class="toggle"
|
|
39
39
|
/>
|
|
40
|
-
</
|
|
41
|
-
</
|
|
40
|
+
</ui_primitive>
|
|
41
|
+
</ui_switch>
|
|
42
42
|
</DocumentFragment>
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
45
|
exports[`primitive:<Switch> prop:checked 1`] = `
|
|
46
46
|
<DocumentFragment>
|
|
47
|
-
<
|
|
47
|
+
<ui_switch
|
|
48
48
|
class="switch"
|
|
49
49
|
>
|
|
50
50
|
<input
|
|
@@ -52,20 +52,20 @@ exports[`primitive:<Switch> prop:checked 1`] = `
|
|
|
52
52
|
name="name"
|
|
53
53
|
type="checkbox"
|
|
54
54
|
/>
|
|
55
|
-
<
|
|
55
|
+
<ui_primitive
|
|
56
56
|
class="area"
|
|
57
57
|
>
|
|
58
|
-
<
|
|
58
|
+
<ui_primitive
|
|
59
59
|
class="toggle"
|
|
60
60
|
/>
|
|
61
|
-
</
|
|
62
|
-
</
|
|
61
|
+
</ui_primitive>
|
|
62
|
+
</ui_switch>
|
|
63
63
|
</DocumentFragment>
|
|
64
64
|
`;
|
|
65
65
|
|
|
66
66
|
exports[`primitive:<Switch> prop:disabled 1`] = `
|
|
67
67
|
<DocumentFragment>
|
|
68
|
-
<
|
|
68
|
+
<ui_switch
|
|
69
69
|
class="switch"
|
|
70
70
|
>
|
|
71
71
|
<input
|
|
@@ -73,20 +73,20 @@ exports[`primitive:<Switch> prop:disabled 1`] = `
|
|
|
73
73
|
name="name"
|
|
74
74
|
type="checkbox"
|
|
75
75
|
/>
|
|
76
|
-
<
|
|
76
|
+
<ui_primitive
|
|
77
77
|
class="area"
|
|
78
78
|
>
|
|
79
|
-
<
|
|
79
|
+
<ui_primitive
|
|
80
80
|
class="toggle"
|
|
81
81
|
/>
|
|
82
|
-
</
|
|
83
|
-
</
|
|
82
|
+
</ui_primitive>
|
|
83
|
+
</ui_switch>
|
|
84
84
|
</DocumentFragment>
|
|
85
85
|
`;
|
|
86
86
|
|
|
87
87
|
exports[`primitive:<Switch> prop:error && disabled 1`] = `
|
|
88
88
|
<DocumentFragment>
|
|
89
|
-
<
|
|
89
|
+
<ui_switch
|
|
90
90
|
class="switch"
|
|
91
91
|
>
|
|
92
92
|
<input
|
|
@@ -94,60 +94,80 @@ exports[`primitive:<Switch> prop:error && disabled 1`] = `
|
|
|
94
94
|
name="name"
|
|
95
95
|
type="checkbox"
|
|
96
96
|
/>
|
|
97
|
-
<
|
|
97
|
+
<ui_primitive
|
|
98
98
|
class="area"
|
|
99
99
|
>
|
|
100
|
-
<
|
|
100
|
+
<ui_primitive
|
|
101
101
|
class="toggle"
|
|
102
102
|
/>
|
|
103
|
-
</
|
|
104
|
-
</
|
|
103
|
+
</ui_primitive>
|
|
104
|
+
</ui_switch>
|
|
105
105
|
</DocumentFragment>
|
|
106
106
|
`;
|
|
107
107
|
|
|
108
108
|
exports[`primitive:<Switch> prop:error 1`] = `
|
|
109
109
|
<DocumentFragment>
|
|
110
|
-
<
|
|
110
|
+
<ui_switch
|
|
111
111
|
class="switch"
|
|
112
112
|
>
|
|
113
113
|
<input
|
|
114
114
|
name="name"
|
|
115
115
|
type="checkbox"
|
|
116
116
|
/>
|
|
117
|
-
<
|
|
117
|
+
<ui_primitive
|
|
118
118
|
class="area error"
|
|
119
119
|
>
|
|
120
|
-
<
|
|
120
|
+
<ui_primitive
|
|
121
121
|
class="toggle"
|
|
122
122
|
/>
|
|
123
|
-
</
|
|
124
|
-
</
|
|
123
|
+
</ui_primitive>
|
|
124
|
+
</ui_switch>
|
|
125
125
|
</DocumentFragment>
|
|
126
126
|
`;
|
|
127
127
|
|
|
128
128
|
exports[`primitive:<Switch> render 1`] = `
|
|
129
129
|
<DocumentFragment>
|
|
130
|
-
<
|
|
130
|
+
<ui_switch
|
|
131
131
|
class="switch"
|
|
132
132
|
>
|
|
133
133
|
<input
|
|
134
134
|
name="name"
|
|
135
135
|
type="checkbox"
|
|
136
136
|
/>
|
|
137
|
-
<
|
|
137
|
+
<ui_primitive
|
|
138
138
|
class="area"
|
|
139
139
|
>
|
|
140
|
-
<
|
|
140
|
+
<ui_primitive
|
|
141
141
|
class="toggle"
|
|
142
142
|
/>
|
|
143
|
-
</
|
|
144
|
-
</
|
|
143
|
+
</ui_primitive>
|
|
144
|
+
</ui_switch>
|
|
145
|
+
</DocumentFragment>
|
|
146
|
+
`;
|
|
147
|
+
|
|
148
|
+
exports[`primitive:<Switch> tag 1`] = `
|
|
149
|
+
<DocumentFragment>
|
|
150
|
+
<ui_tag
|
|
151
|
+
class="switch"
|
|
152
|
+
>
|
|
153
|
+
<input
|
|
154
|
+
name="name"
|
|
155
|
+
type="checkbox"
|
|
156
|
+
/>
|
|
157
|
+
<ui_primitive
|
|
158
|
+
class="area"
|
|
159
|
+
>
|
|
160
|
+
<ui_primitive
|
|
161
|
+
class="toggle"
|
|
162
|
+
/>
|
|
163
|
+
</ui_primitive>
|
|
164
|
+
</ui_tag>
|
|
145
165
|
</DocumentFragment>
|
|
146
166
|
`;
|
|
147
167
|
|
|
148
168
|
exports[`primitive:<Switch> testId 1`] = `
|
|
149
169
|
<DocumentFragment>
|
|
150
|
-
<
|
|
170
|
+
<ui_switch
|
|
151
171
|
class="switch"
|
|
152
172
|
data-testid="mirai"
|
|
153
173
|
>
|
|
@@ -155,13 +175,13 @@ exports[`primitive:<Switch> testId 1`] = `
|
|
|
155
175
|
name="name"
|
|
156
176
|
type="checkbox"
|
|
157
177
|
/>
|
|
158
|
-
<
|
|
178
|
+
<ui_primitive
|
|
159
179
|
class="area"
|
|
160
180
|
>
|
|
161
|
-
<
|
|
181
|
+
<ui_primitive
|
|
162
182
|
class="toggle"
|
|
163
183
|
/>
|
|
164
|
-
</
|
|
165
|
-
</
|
|
184
|
+
</ui_primitive>
|
|
185
|
+
</ui_switch>
|
|
166
186
|
</DocumentFragment>
|
|
167
187
|
`;
|
|
@@ -40,7 +40,8 @@ var Text = function Text(_ref) {
|
|
|
40
40
|
markdown = _ref$markdown === void 0 ? true : _ref$markdown,
|
|
41
41
|
small = _ref.small,
|
|
42
42
|
success = _ref.success,
|
|
43
|
-
tag = _ref.tag,
|
|
43
|
+
_ref$tag = _ref.tag,
|
|
44
|
+
tag = _ref$tag === void 0 ? 'text' : _ref$tag,
|
|
44
45
|
tiny = _ref.tiny,
|
|
45
46
|
underline = _ref.underline,
|
|
46
47
|
upperCase = _ref.upperCase,
|
|
@@ -49,7 +50,7 @@ var Text = function Text(_ref) {
|
|
|
49
50
|
others = _objectWithoutProperties(_ref, _excluded);
|
|
50
51
|
return /*#__PURE__*/_react.default.createElement(_Primitive.Primitive, _objectSpread(_objectSpread({}, others), {}, {
|
|
51
52
|
role: others.role || 'text',
|
|
52
|
-
tag: tag
|
|
53
|
+
tag: tag,
|
|
53
54
|
className: (0, _helpers.styles)(_TextModule.default.text, bold && _TextModule.default.bold, brand && _TextModule.default.brand, capitalize && _TextModule.default.capitalize, (0, _helpers2.color)({
|
|
54
55
|
accent: accent,
|
|
55
56
|
accentDark: accentDark,
|
|
@@ -61,7 +62,7 @@ var Text = function Text(_ref) {
|
|
|
61
62
|
success: success,
|
|
62
63
|
warning: warning
|
|
63
64
|
}), headline ? _TextModule.default["headline-".concat(level)] : action ? _TextModule.default.action : small ? _TextModule.default.small : tiny ? _TextModule.default.tiny : _TextModule.default.paragraph, underline && _TextModule.default.underline, upperCase && _TextModule.default.upperCase, wide && _TextModule.default.wide, others.className)
|
|
64
|
-
}), markdown ? (0, _helpers2.parseMarkdown)(children) : children);
|
|
65
|
+
}), markdown ? (0, _helpers2.parseMarkdown)(children, tag) : children);
|
|
65
66
|
};
|
|
66
67
|
exports.Text = Text;
|
|
67
68
|
Text.displayName = 'Primitive:Text';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","names":["Text","accent","accentLight","accentDark","action","bold","brand","capitalize","children","dark","error","headline","info","level","light","markdown","small","success","tag","tiny","underline","upperCase","warning","wide","others","React","createElement","Primitive","role","className","styles","style","text","color","paragraph","parseMarkdown","displayName","propTypes","PropTypes","bool","oneOfType","string","number","array"],"sources":["../../../src/primitives/Text/Text.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport { color, parseMarkdown } from './helpers';\nimport style from './Text.module.css';\n\nconst Text = ({\n accent,\n accentLight,\n accentDark,\n action,\n bold,\n brand,\n capitalize,\n children,\n dark,\n error,\n headline,\n info,\n level = 3,\n light,\n markdown = true,\n small,\n success,\n tag,\n tiny,\n underline,\n upperCase,\n warning,\n wide,\n ...others\n}) =>\n React.createElement(\n Primitive,\n {\n ...others,\n role: others.role || 'text',\n tag
|
|
1
|
+
{"version":3,"file":"Text.js","names":["Text","accent","accentLight","accentDark","action","bold","brand","capitalize","children","dark","error","headline","info","level","light","markdown","small","success","tag","tiny","underline","upperCase","warning","wide","others","React","createElement","Primitive","role","className","styles","style","text","color","paragraph","parseMarkdown","displayName","propTypes","PropTypes","bool","oneOfType","string","number","array"],"sources":["../../../src/primitives/Text/Text.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport { color, parseMarkdown } from './helpers';\nimport style from './Text.module.css';\n\nconst Text = ({\n accent,\n accentLight,\n accentDark,\n action,\n bold,\n brand,\n capitalize,\n children,\n dark,\n error,\n headline,\n info,\n level = 3,\n light,\n markdown = true,\n small,\n success,\n tag = 'text',\n tiny,\n underline,\n upperCase,\n warning,\n wide,\n ...others\n}) =>\n React.createElement(\n Primitive,\n {\n ...others,\n role: others.role || 'text',\n tag,\n className: styles(\n style.text,\n bold && style.bold,\n brand && style.brand,\n capitalize && style.capitalize,\n color({ accent, accentDark, accentLight, dark, error, info, light, success, warning }),\n headline\n ? style[`headline-${level}`]\n : action\n ? style.action\n : small\n ? style.small\n : tiny\n ? style.tiny\n : style.paragraph,\n underline && style.underline,\n upperCase && style.upperCase,\n wide && style.wide,\n others.className,\n ),\n },\n markdown ? parseMarkdown(children, tag) : children,\n );\n\nText.displayName = 'Primitive:Text';\n\nText.propTypes = {\n accent: PropTypes.bool,\n accentLight: PropTypes.bool,\n accentDark: PropTypes.bool,\n action: PropTypes.bool,\n bold: PropTypes.bool,\n brand: PropTypes.bool,\n capitalize: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),\n dark: PropTypes.bool,\n error: PropTypes.bool,\n headline: PropTypes.bool,\n info: PropTypes.bool,\n level: PropTypes.number,\n light: PropTypes.bool,\n markdown: PropTypes.bool,\n small: PropTypes.bool,\n success: PropTypes.bool,\n tag: PropTypes.string,\n tiny: PropTypes.bool,\n underline: PropTypes.bool,\n upperCase: PropTypes.bool,\n warning: PropTypes.bool,\n wide: PropTypes.bool,\n};\n\nexport { Text };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEtC,IAAMA,IAAI,GAAG,SAAPA,IAAI;EAAA,IACRC,MAAM,QAANA,MAAM;IACNC,WAAW,QAAXA,WAAW;IACXC,UAAU,QAAVA,UAAU;IACVC,MAAM,QAANA,MAAM;IACNC,IAAI,QAAJA,IAAI;IACJC,KAAK,QAALA,KAAK;IACLC,UAAU,QAAVA,UAAU;IACVC,QAAQ,QAARA,QAAQ;IACRC,IAAI,QAAJA,IAAI;IACJC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,IAAI,QAAJA,IAAI;IAAA,kBACJC,KAAK;IAALA,KAAK,2BAAG,CAAC;IACTC,KAAK,QAALA,KAAK;IAAA,qBACLC,QAAQ;IAARA,QAAQ,8BAAG,IAAI;IACfC,KAAK,QAALA,KAAK;IACLC,OAAO,QAAPA,OAAO;IAAA,gBACPC,GAAG;IAAHA,GAAG,yBAAG,MAAM;IACZC,IAAI,QAAJA,IAAI;IACJC,SAAS,QAATA,SAAS;IACTC,SAAS,QAATA,SAAS;IACTC,OAAO,QAAPA,OAAO;IACPC,IAAI,QAAJA,IAAI;IACDC,MAAM;EAAA,oBAETC,cAAK,CAACC,aAAa,CACjBC,oBAAS,kCAEJH,MAAM;IACTI,IAAI,EAAEJ,MAAM,CAACI,IAAI,IAAI,MAAM;IAC3BV,GAAG,EAAHA,GAAG;IACHW,SAAS,EAAE,IAAAC,eAAM,EACfC,mBAAK,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