@cloud-ru/ds-uikit-product-modal-predefined 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +201 -0
- package/README.md +359 -0
- package/dist/cjs/components/DeleteModal/DeleteModal.d.ts +2 -0
- package/dist/cjs/components/DeleteModal/DeleteModal.js +39 -0
- package/dist/cjs/components/DeleteModal/index.d.ts +1 -0
- package/dist/cjs/components/DeleteModal/index.js +17 -0
- package/dist/cjs/components/DeleteModal/styles.module.css +33 -0
- package/dist/cjs/components/RecallModal/RecallModal.d.ts +2 -0
- package/dist/cjs/components/RecallModal/RecallModal.js +37 -0
- package/dist/cjs/components/RecallModal/index.d.ts +1 -0
- package/dist/cjs/components/RecallModal/index.js +17 -0
- package/dist/cjs/components/RecallModal/styles.module.css +33 -0
- package/dist/cjs/components/ReleaseNotes/ReleaseNotes.d.ts +7 -0
- package/dist/cjs/components/ReleaseNotes/ReleaseNotes.js +15 -0
- package/dist/cjs/components/ReleaseNotes/index.d.ts +1 -0
- package/dist/cjs/components/ReleaseNotes/index.js +17 -0
- package/dist/cjs/components/index.d.ts +3 -0
- package/dist/cjs/components/index.js +19 -0
- package/dist/cjs/constants.d.ts +27 -0
- package/dist/cjs/constants.js +30 -0
- package/dist/cjs/helperComponents/DesktopReleaseNotes/DesktopReleaseNotes.d.ts +2 -0
- package/dist/cjs/helperComponents/DesktopReleaseNotes/DesktopReleaseNotes.js +21 -0
- package/dist/cjs/helperComponents/DesktopReleaseNotes/index.d.ts +1 -0
- package/dist/cjs/helperComponents/DesktopReleaseNotes/index.js +17 -0
- package/dist/cjs/helperComponents/DesktopReleaseNotes/styles.module.css +19 -0
- package/dist/cjs/helperComponents/InputConfirm/InputConfirm.d.ts +48 -0
- package/dist/cjs/helperComponents/InputConfirm/InputConfirm.js +15 -0
- package/dist/cjs/helperComponents/InputConfirm/index.d.ts +1 -0
- package/dist/cjs/helperComponents/InputConfirm/index.js +17 -0
- package/dist/cjs/helperComponents/InputConfirm/styles.module.css +38 -0
- package/dist/cjs/helperComponents/MobileReleaseNotes/MobileReleaseNotes.d.ts +2 -0
- package/dist/cjs/helperComponents/MobileReleaseNotes/MobileReleaseNotes.js +26 -0
- package/dist/cjs/helperComponents/MobileReleaseNotes/index.d.ts +1 -0
- package/dist/cjs/helperComponents/MobileReleaseNotes/index.js +17 -0
- package/dist/cjs/helperComponents/NoteItem/NoteItem.d.ts +6 -0
- package/dist/cjs/helperComponents/NoteItem/NoteItem.js +20 -0
- package/dist/cjs/helperComponents/NoteItem/index.d.ts +1 -0
- package/dist/cjs/helperComponents/NoteItem/index.js +17 -0
- package/dist/cjs/helperComponents/NoteItem/styles.module.css +53 -0
- package/dist/cjs/helperComponents/ReleaseNotesContent/ReleaseNotesContent.d.ts +28 -0
- package/dist/cjs/helperComponents/ReleaseNotesContent/ReleaseNotesContent.js +30 -0
- package/dist/cjs/helperComponents/ReleaseNotesContent/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ReleaseNotesContent/index.js +17 -0
- package/dist/cjs/helperComponents/ReleaseNotesContent/styles.module.css +40 -0
- package/dist/cjs/helperComponents/ReleaseNotesFooter/ReleaseNotesFooter.d.ts +25 -0
- package/dist/cjs/helperComponents/ReleaseNotesFooter/ReleaseNotesFooter.js +17 -0
- package/dist/cjs/helperComponents/ReleaseNotesFooter/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ReleaseNotesFooter/index.js +17 -0
- package/dist/cjs/helperComponents/ReleaseNotesFooter/styles.module.css +27 -0
- package/dist/cjs/helperComponents/index.d.ts +6 -0
- package/dist/cjs/helperComponents/index.js +22 -0
- package/dist/cjs/hooks.d.ts +26 -0
- package/dist/cjs/hooks.js +59 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/locale/index.d.ts +143 -0
- package/dist/cjs/locale/index.js +76 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +243 -0
- package/dist/cjs/types.d.ts +67 -0
- package/dist/cjs/types.js +2 -0
- package/dist/esm/components/DeleteModal/DeleteModal.d.ts +2 -0
- package/dist/esm/components/DeleteModal/DeleteModal.js +33 -0
- package/dist/esm/components/DeleteModal/index.d.ts +1 -0
- package/dist/esm/components/DeleteModal/index.js +1 -0
- package/dist/esm/components/DeleteModal/styles.module.css +33 -0
- package/dist/esm/components/RecallModal/RecallModal.d.ts +2 -0
- package/dist/esm/components/RecallModal/RecallModal.js +31 -0
- package/dist/esm/components/RecallModal/index.d.ts +1 -0
- package/dist/esm/components/RecallModal/index.js +1 -0
- package/dist/esm/components/RecallModal/styles.module.css +33 -0
- package/dist/esm/components/ReleaseNotes/ReleaseNotes.d.ts +7 -0
- package/dist/esm/components/ReleaseNotes/ReleaseNotes.js +12 -0
- package/dist/esm/components/ReleaseNotes/index.d.ts +1 -0
- package/dist/esm/components/ReleaseNotes/index.js +1 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/constants.d.ts +27 -0
- package/dist/esm/constants.js +27 -0
- package/dist/esm/helperComponents/DesktopReleaseNotes/DesktopReleaseNotes.d.ts +2 -0
- package/dist/esm/helperComponents/DesktopReleaseNotes/DesktopReleaseNotes.js +15 -0
- package/dist/esm/helperComponents/DesktopReleaseNotes/index.d.ts +1 -0
- package/dist/esm/helperComponents/DesktopReleaseNotes/index.js +1 -0
- package/dist/esm/helperComponents/DesktopReleaseNotes/styles.module.css +19 -0
- package/dist/esm/helperComponents/InputConfirm/InputConfirm.d.ts +48 -0
- package/dist/esm/helperComponents/InputConfirm/InputConfirm.js +9 -0
- package/dist/esm/helperComponents/InputConfirm/index.d.ts +1 -0
- package/dist/esm/helperComponents/InputConfirm/index.js +1 -0
- package/dist/esm/helperComponents/InputConfirm/styles.module.css +38 -0
- package/dist/esm/helperComponents/MobileReleaseNotes/MobileReleaseNotes.d.ts +2 -0
- package/dist/esm/helperComponents/MobileReleaseNotes/MobileReleaseNotes.js +23 -0
- package/dist/esm/helperComponents/MobileReleaseNotes/index.d.ts +1 -0
- package/dist/esm/helperComponents/MobileReleaseNotes/index.js +1 -0
- package/dist/esm/helperComponents/NoteItem/NoteItem.d.ts +6 -0
- package/dist/esm/helperComponents/NoteItem/NoteItem.js +14 -0
- package/dist/esm/helperComponents/NoteItem/index.d.ts +1 -0
- package/dist/esm/helperComponents/NoteItem/index.js +1 -0
- package/dist/esm/helperComponents/NoteItem/styles.module.css +53 -0
- package/dist/esm/helperComponents/ReleaseNotesContent/ReleaseNotesContent.d.ts +28 -0
- package/dist/esm/helperComponents/ReleaseNotesContent/ReleaseNotesContent.js +24 -0
- package/dist/esm/helperComponents/ReleaseNotesContent/index.d.ts +1 -0
- package/dist/esm/helperComponents/ReleaseNotesContent/index.js +1 -0
- package/dist/esm/helperComponents/ReleaseNotesContent/styles.module.css +40 -0
- package/dist/esm/helperComponents/ReleaseNotesFooter/ReleaseNotesFooter.d.ts +25 -0
- package/dist/esm/helperComponents/ReleaseNotesFooter/ReleaseNotesFooter.js +11 -0
- package/dist/esm/helperComponents/ReleaseNotesFooter/index.d.ts +1 -0
- package/dist/esm/helperComponents/ReleaseNotesFooter/index.js +1 -0
- package/dist/esm/helperComponents/ReleaseNotesFooter/styles.module.css +27 -0
- package/dist/esm/helperComponents/index.d.ts +6 -0
- package/dist/esm/helperComponents/index.js +6 -0
- package/dist/esm/hooks.d.ts +26 -0
- package/dist/esm/hooks.js +55 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/locale/index.d.ts +143 -0
- package/dist/esm/locale/index.js +73 -0
- package/dist/esm/style.css +243 -0
- package/dist/esm/types.d.ts +67 -0
- package/dist/esm/types.js +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +63 -0
- package/src/components/DeleteModal/DeleteModal.tsx +116 -0
- package/src/components/DeleteModal/index.ts +1 -0
- package/src/components/DeleteModal/styles.module.scss +37 -0
- package/src/components/RecallModal/RecallModal.tsx +111 -0
- package/src/components/RecallModal/index.ts +1 -0
- package/src/components/RecallModal/styles.module.scss +37 -0
- package/src/components/ReleaseNotes/ReleaseNotes.tsx +15 -0
- package/src/components/ReleaseNotes/index.ts +1 -0
- package/src/components/index.ts +3 -0
- package/src/constants.ts +29 -0
- package/src/helperComponents/DesktopReleaseNotes/DesktopReleaseNotes.tsx +85 -0
- package/src/helperComponents/DesktopReleaseNotes/index.ts +1 -0
- package/src/helperComponents/DesktopReleaseNotes/styles.module.scss +24 -0
- package/src/helperComponents/InputConfirm/InputConfirm.tsx +72 -0
- package/src/helperComponents/InputConfirm/index.ts +1 -0
- package/src/helperComponents/InputConfirm/styles.module.scss +30 -0
- package/src/helperComponents/MobileReleaseNotes/MobileReleaseNotes.tsx +88 -0
- package/src/helperComponents/MobileReleaseNotes/index.ts +1 -0
- package/src/helperComponents/NoteItem/NoteItem.tsx +58 -0
- package/src/helperComponents/NoteItem/index.ts +1 -0
- package/src/helperComponents/NoteItem/styles.module.scss +54 -0
- package/src/helperComponents/ReleaseNotesContent/ReleaseNotesContent.tsx +119 -0
- package/src/helperComponents/ReleaseNotesContent/index.ts +1 -0
- package/src/helperComponents/ReleaseNotesContent/styles.module.scss +45 -0
- package/src/helperComponents/ReleaseNotesFooter/ReleaseNotesFooter.tsx +84 -0
- package/src/helperComponents/ReleaseNotesFooter/index.ts +1 -0
- package/src/helperComponents/ReleaseNotesFooter/styles.module.scss +25 -0
- package/src/helperComponents/index.ts +6 -0
- package/src/hooks.ts +89 -0
- package/src/index.ts +4 -0
- package/src/locale/index.ts +77 -0
- package/src/types.ts +80 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2023 Cloud technology Limited (Ltd.)
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# ModalPredefined
|
|
2
|
+
|
|
3
|
+
`@cloud-ru/ds-uikit-product-modal-predefined` — Product preset-компоненты для delete, recall и release notes сценариев на базе Modal и BottomSheet.
|
|
4
|
+
|
|
5
|
+
Пакет `@cloud-ru/ds-uikit-product-modal-predefined` предоставляет готовые product-сценарии поверх `@cloud-ru/ds-modal` и `@cloud-ru/ds-bottom-sheet`.
|
|
6
|
+
|
|
7
|
+
- **DeleteModal** — удаление объекта с опциональным подтверждением через ввод текста.
|
|
8
|
+
- **RecallModal** — отзыв действия с тем же Figma-first `confirmable` состоянием.
|
|
9
|
+
- **ReleaseNotes** — адаптивный release notes: модальное окно на desktop, bottom sheet на mobile; состояния `data`, `noData`, `error`.
|
|
10
|
+
|
|
11
|
+
## Установка
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @cloud-ru/ds-uikit-product-modal-predefined
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { DeleteModal, RecallModal, ReleaseNotes } from '@cloud-ru/ds-uikit-product-modal-predefined'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Figma
|
|
22
|
+
|
|
23
|
+
Источник: `Product UI Kit (variables)`, root node `3179:1987`.
|
|
24
|
+
|
|
25
|
+
Пакет следует Figma-first API: `confirmable` и `contentState` являются публичными визуальными осями. Legacy `@cloud-ru/uikit-product-modal-predefined` используется как источник поведения, но новый пакет не является drop-in заменой legacy API.
|
|
26
|
+
|
|
27
|
+
## DeleteModal
|
|
28
|
+
|
|
29
|
+
Готовое модальное окно удаления с Figma-first состоянием confirmable.
|
|
30
|
+
|
|
31
|
+
`DeleteModal` — готовый сценарий удаления объекта. Для варианта из макета `deleteModalConfirmable` используйте `confirmable` и `confirmText`.
|
|
32
|
+
|
|
33
|
+
### Примеры использования
|
|
34
|
+
|
|
35
|
+
#### Базовое удаление
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
39
|
+
import { DeleteModal } from '@cloud-ru/ds-uikit-product-modal-predefined';
|
|
40
|
+
import { useState } from 'react';
|
|
41
|
+
|
|
42
|
+
export function DeleteBasic() {
|
|
43
|
+
const [open, setOpen] = useState(false);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<Button label='Open delete modal' view='filled' appearance='primary' onClick={() => setOpen(true)} />
|
|
48
|
+
<DeleteModal
|
|
49
|
+
open={open}
|
|
50
|
+
onClose={() => setOpen(false)}
|
|
51
|
+
objectType='виртуальную машину'
|
|
52
|
+
onDelete={close => close()}
|
|
53
|
+
/>
|
|
54
|
+
</>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### Удаление с подтверждением
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
63
|
+
import { DeleteModal } from '@cloud-ru/ds-uikit-product-modal-predefined';
|
|
64
|
+
import { useState } from 'react';
|
|
65
|
+
|
|
66
|
+
export function DeleteConfirmable() {
|
|
67
|
+
const [open, setOpen] = useState(false);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
<Button label='Open confirmable delete modal' view='filled' appearance='primary' onClick={() => setOpen(true)} />
|
|
72
|
+
<DeleteModal
|
|
73
|
+
open={open}
|
|
74
|
+
onClose={() => setOpen(false)}
|
|
75
|
+
objectType='виртуальную машину'
|
|
76
|
+
confirmable
|
|
77
|
+
confirmText='vm-production-01'
|
|
78
|
+
onDelete={close => close()}
|
|
79
|
+
/>
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Props
|
|
86
|
+
|
|
87
|
+
**DeleteModalProps**
|
|
88
|
+
|
|
89
|
+
| Prop | Type | Default | Description |
|
|
90
|
+
|------|------|---------|-------------|
|
|
91
|
+
| `closeOnPopstate` | `boolean` | — | Закрытие при навигации по истории |
|
|
92
|
+
| `confirmText` | `string` | — | Текст, который нужно ввести для подтверждения |
|
|
93
|
+
| `confirmTextVariant` | `"name"` \| `"text"` | `name` | Тип текста подтверждения |
|
|
94
|
+
| `confirmable` | `boolean` | `false` | Состояние с подтверждением через ввод текста |
|
|
95
|
+
| `content` | `ReactNode` | — | Основной текст модалки |
|
|
96
|
+
| `data-test-id` | `string` | — | |
|
|
97
|
+
| `deleting` | `boolean` | — | Состояние загрузки кнопки удаления |
|
|
98
|
+
| `hideConfirmCopyButton` | `boolean` | — | Скрыть кнопку копирования текста подтверждения |
|
|
99
|
+
| `mode` | `"aggressive"` \| `"forced"` \| `"regular"` | `MODE.Regular` | Режим закрытия: Regular — overlay/Esc/кнопка; Aggressive — только кнопка; Forced — без кнопки и overlay/Esc. |
|
|
100
|
+
| `objectType` | `string` | — | Тип удаляемого объекта, отображается в заголовке |
|
|
101
|
+
| `onClose` | `() => void` | — | Колбэк закрытия |
|
|
102
|
+
| `onDelete` | `(onClose: () => void) => void` | — | Колбэк подтверждения удаления |
|
|
103
|
+
| `open` | `boolean` | — | Управление состоянием показан/не показан |
|
|
104
|
+
| `subtitle` | `ReactNode` | — | Подзаголовок |
|
|
105
|
+
| `titleTooltip` | `ReactNode` | — | Подсказка рядом с заголовком |
|
|
106
|
+
|
|
107
|
+
##### Related types
|
|
108
|
+
|
|
109
|
+
- `ConfirmTextVariant` = `"name"` \| `"text"`
|
|
110
|
+
|
|
111
|
+
## RecallModal
|
|
112
|
+
|
|
113
|
+
Готовое модальное окно отзыва действия с опциональным confirmable состоянием.
|
|
114
|
+
|
|
115
|
+
`RecallModal` — готовый сценарий отзыва действия. Визуальная ось `confirmable` соответствует макету `recallModalConfirmable`.
|
|
116
|
+
|
|
117
|
+
### Примеры использования
|
|
118
|
+
|
|
119
|
+
#### Базовый отзыв
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
123
|
+
import { RecallModal } from '@cloud-ru/ds-uikit-product-modal-predefined';
|
|
124
|
+
import { useState } from 'react';
|
|
125
|
+
|
|
126
|
+
export function RecallBasic() {
|
|
127
|
+
const [open, setOpen] = useState(false);
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<>
|
|
131
|
+
<Button label='Open recall modal' view='filled' appearance='primary' onClick={() => setOpen(true)} />
|
|
132
|
+
<RecallModal open={open} onClose={() => setOpen(false)} onRecall={close => close()} />
|
|
133
|
+
</>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### Отзыв с подтверждением
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
142
|
+
import { RecallModal } from '@cloud-ru/ds-uikit-product-modal-predefined';
|
|
143
|
+
import { useState } from 'react';
|
|
144
|
+
|
|
145
|
+
export function RecallConfirmable() {
|
|
146
|
+
const [open, setOpen] = useState(false);
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<>
|
|
150
|
+
<Button label='Open confirmable recall modal' view='filled' appearance='primary' onClick={() => setOpen(true)} />
|
|
151
|
+
<RecallModal
|
|
152
|
+
open={open}
|
|
153
|
+
onClose={() => setOpen(false)}
|
|
154
|
+
confirmable
|
|
155
|
+
confirmText='recall-operation-01'
|
|
156
|
+
onRecall={close => close()}
|
|
157
|
+
/>
|
|
158
|
+
</>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Props
|
|
164
|
+
|
|
165
|
+
**RecallModalProps**
|
|
166
|
+
|
|
167
|
+
| Prop | Type | Default | Description |
|
|
168
|
+
|------|------|---------|-------------|
|
|
169
|
+
| `closeOnPopstate` | `boolean` | — | Закрытие при навигации по истории |
|
|
170
|
+
| `confirmText` | `string` | — | Текст, который нужно ввести для подтверждения |
|
|
171
|
+
| `confirmable` | `boolean` | `false` | Состояние с подтверждением через ввод текста |
|
|
172
|
+
| `content` | `ReactNode` | — | Основной текст модалки |
|
|
173
|
+
| `data-test-id` | `string` | — | |
|
|
174
|
+
| `hideConfirmCopyButton` | `boolean` | — | Скрыть кнопку копирования текста подтверждения |
|
|
175
|
+
| `loading` | `boolean` | — | Состояние загрузки кнопки отзыва |
|
|
176
|
+
| `mode` | `"aggressive"` \| `"forced"` \| `"regular"` | `MODE.Regular` | Режим закрытия: Regular — overlay/Esc/кнопка; Aggressive — только кнопка; Forced — без кнопки и overlay/Esc. |
|
|
177
|
+
| `onClose` | `() => void` | — | Колбэк закрытия |
|
|
178
|
+
| `onRecall` | `(onClose: () => void) => void` | — | Колбэк подтверждения отзыва |
|
|
179
|
+
| `open` | `boolean` | — | Управление состоянием показан/не показан |
|
|
180
|
+
| `subtitle` | `ReactNode` | — | Подзаголовок |
|
|
181
|
+
| `titleTooltip` | `ReactNode` | — | Подсказка рядом с заголовком |
|
|
182
|
+
|
|
183
|
+
## ReleaseNotes
|
|
184
|
+
|
|
185
|
+
Адаптивный release notes preset — модальное окно на desktop, bottom sheet на mobile.
|
|
186
|
+
|
|
187
|
+
`ReleaseNotes` — адаптивный preset для показа новостей платформы. На desktop это модальное окно, на mobile — bottom sheet; поверхность выбирается автоматически по раскладке. Публичная визуальная ось `contentState` принимает `data`, `noData`, `error`.
|
|
188
|
+
|
|
189
|
+
### Примеры использования
|
|
190
|
+
|
|
191
|
+
#### Данные
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
195
|
+
import { ReleaseNotes } from '@cloud-ru/ds-uikit-product-modal-predefined';
|
|
196
|
+
import { useState } from 'react';
|
|
197
|
+
|
|
198
|
+
import { releaseNotesItems } from './releaseNotesItems';
|
|
199
|
+
|
|
200
|
+
export function ReleaseNotesData() {
|
|
201
|
+
const [open, setOpen] = useState(false);
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<>
|
|
205
|
+
<Button label='Open release notes' view='filled' appearance='primary' onClick={() => setOpen(true)} />
|
|
206
|
+
<ReleaseNotes open={open} onClose={() => setOpen(false)} items={releaseNotesItems} />
|
|
207
|
+
</>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### Нет данных
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
216
|
+
import { ReleaseNotes } from '@cloud-ru/ds-uikit-product-modal-predefined';
|
|
217
|
+
import { useState } from 'react';
|
|
218
|
+
|
|
219
|
+
import { releaseNotesItems } from './releaseNotesItems';
|
|
220
|
+
|
|
221
|
+
export function ReleaseNotesNoData() {
|
|
222
|
+
const [open, setOpen] = useState(false);
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<>
|
|
226
|
+
<Button label='Open no-data release notes' view='filled' appearance='primary' onClick={() => setOpen(true)} />
|
|
227
|
+
<ReleaseNotes open={open} onClose={() => setOpen(false)} contentState='noData' items={releaseNotesItems} />
|
|
228
|
+
</>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### Ошибка загрузки
|
|
234
|
+
|
|
235
|
+
```tsx
|
|
236
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
237
|
+
import { ReleaseNotes } from '@cloud-ru/ds-uikit-product-modal-predefined';
|
|
238
|
+
import { useState } from 'react';
|
|
239
|
+
|
|
240
|
+
import { releaseNotesItems } from './releaseNotesItems';
|
|
241
|
+
|
|
242
|
+
export function ReleaseNotesError() {
|
|
243
|
+
const [open, setOpen] = useState(false);
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<>
|
|
247
|
+
<Button label='Open error release notes' view='filled' appearance='primary' onClick={() => setOpen(true)} />
|
|
248
|
+
<ReleaseNotes
|
|
249
|
+
open={open}
|
|
250
|
+
onClose={() => setOpen(false)}
|
|
251
|
+
contentState='error'
|
|
252
|
+
items={releaseNotesItems}
|
|
253
|
+
onDataErrorRetryClick={() => undefined}
|
|
254
|
+
/>
|
|
255
|
+
</>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
#### Видео в новости
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
import { Button } from '@cloud-ru/ds-button';
|
|
264
|
+
import { ReleaseNotes } from '@cloud-ru/ds-uikit-product-modal-predefined';
|
|
265
|
+
import { useState } from 'react';
|
|
266
|
+
|
|
267
|
+
import { releaseNotesItems } from './releaseNotesItems';
|
|
268
|
+
|
|
269
|
+
export function ReleaseNotesVideo() {
|
|
270
|
+
const [open, setOpen] = useState(false);
|
|
271
|
+
|
|
272
|
+
return (
|
|
273
|
+
<>
|
|
274
|
+
<Button label='Open video release notes' view='filled' appearance='primary' onClick={() => setOpen(true)} />
|
|
275
|
+
<ReleaseNotes
|
|
276
|
+
open={open}
|
|
277
|
+
onClose={() => setOpen(false)}
|
|
278
|
+
items={[
|
|
279
|
+
{
|
|
280
|
+
...releaseNotesItems[0],
|
|
281
|
+
video: 'https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4',
|
|
282
|
+
},
|
|
283
|
+
]}
|
|
284
|
+
/>
|
|
285
|
+
</>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Props
|
|
291
|
+
|
|
292
|
+
**ReleaseNotesProps**
|
|
293
|
+
|
|
294
|
+
| Prop | Type | Default | Description |
|
|
295
|
+
|------|------|---------|-------------|
|
|
296
|
+
| `closeOnPopstate` | `boolean` | — | Закрытие при навигации по истории |
|
|
297
|
+
| `contentState` | `"data"` \| `"error"` \| `"noData"` | — | Визуальное состояние контента по Figma |
|
|
298
|
+
| `data-test-id` | `string` | — | |
|
|
299
|
+
| `items` | `NoteItemProps` | — | Массив новостей |
|
|
300
|
+
| `loading` | `boolean` | — | Состояние загрузки контента |
|
|
301
|
+
| `onClose` | `() => void` | — | Колбэк закрытия |
|
|
302
|
+
| `onDataErrorRetryClick` | `(() => void)` | — | Действие перезагрузки на экране ошибки |
|
|
303
|
+
| `onReadLaterClick` | `(() => void)` | — | Действие "Ознакомиться позже" |
|
|
304
|
+
| `onSlideChange` | `((slide: number) => void)` | — | Действие при смене слайда |
|
|
305
|
+
| `open` | `boolean` | — | Управление состоянием показан/не показан |
|
|
306
|
+
| `readLaterButtonProps` | `ButtonProps` | — | Только mobile: дополнительные пропсы action-кнопки "Ознакомиться позже" (на desktop игнорируется). |
|
|
307
|
+
|
|
308
|
+
##### Related types
|
|
309
|
+
|
|
310
|
+
**NoteItemProps**
|
|
311
|
+
|
|
312
|
+
| Prop | Type | Default | Description |
|
|
313
|
+
|------|------|---------|-------------|
|
|
314
|
+
| `description` | `string` | — | Описание новости в markdown |
|
|
315
|
+
| `image` | `{ src: string; alt: string; }` | — | Иллюстрация |
|
|
316
|
+
| `title` | `string` | — | Заголовок новости |
|
|
317
|
+
| `video` | `string \| undefined` | — | Видео вместо статичной иллюстрации |
|
|
318
|
+
|
|
319
|
+
- `ReleaseNotesContentState` = `"data"` \| `"error"` \| `"noData"`
|
|
320
|
+
|
|
321
|
+
### Адаптивность
|
|
322
|
+
|
|
323
|
+
`ReleaseNotes` — адаптивный компонент с переключением поверхности (surface-swap). Раскладку он берёт из `AdaptiveProvider` (контекст `@cloud-ru/ds-adaptive`); публичный API единый для обеих платформ:
|
|
324
|
+
|
|
325
|
+
- **desktop** (по умолчанию) — модальное окно (`ModalCustom` из `@cloud-ru/ds-modal`) с каруселью новостей и постраничной навигацией.
|
|
326
|
+
- **mobile** — контент рендерится в `BottomSheet` из `@cloud-ru/ds-bottom-sheet` (панель снизу со свайпом для закрытия).
|
|
327
|
+
|
|
328
|
+
Верстайте под desktop и поставьте один `<AdaptiveProvider>` в корне приложения — mobile-поверхность включается автоматически (desktop-first). Пропа `layoutType` у компонента нет: источник раскладки — только контекст.
|
|
329
|
+
|
|
330
|
+
#### Как форсировать платформу
|
|
331
|
+
|
|
332
|
+
Форс — только контекстом, не пропом:
|
|
333
|
+
|
|
334
|
+
- Поддерево — вложенный провайдер:
|
|
335
|
+
```tsx
|
|
336
|
+
import { AdaptiveProvider } from '@cloud-ru/ds-adaptive'
|
|
337
|
+
|
|
338
|
+
<AdaptiveProvider layoutType='mobile'>
|
|
339
|
+
<ReleaseNotes open={open} onClose={close} items={items} />
|
|
340
|
+
</AdaptiveProvider>
|
|
341
|
+
```
|
|
342
|
+
- Отдельный компонент — `withLayoutType` (module-scope, сахар над провайдером):
|
|
343
|
+
```tsx
|
|
344
|
+
import { withLayoutType } from '@cloud-ru/ds-adaptive'
|
|
345
|
+
import { ReleaseNotes } from '@cloud-ru/ds-uikit-product-modal-predefined'
|
|
346
|
+
|
|
347
|
+
const MobileReleaseNotes = withLayoutType(ReleaseNotes, 'mobile')
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
#### Платформенные пропы
|
|
351
|
+
|
|
352
|
+
Таблица синхронизирована с type-level JSDoc у `ReleaseNotesProps`.
|
|
353
|
+
|
|
354
|
+
| Пропы | desktop | mobile |
|
|
355
|
+
|-------|---------|--------|
|
|
356
|
+
| `readLaterButtonProps` | игнорируется | используется |
|
|
357
|
+
| `open`, `onClose`, `container`, `closeOnPopstate`, `contentState`, `items`, `loading`, `onReadLaterClick`, `onDataErrorRetryClick`, `onSlideChange` | используется | используется |
|
|
358
|
+
|
|
359
|
+
Подробнее о модели адаптивности — **Adaptive**.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DeleteModalProps } from '../../types';
|
|
2
|
+
export declare function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content, confirmable, confirmText, hideConfirmCopyButton, subtitle, confirmTextVariant, ...rest }: DeleteModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DeleteModal = DeleteModal;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const button_1 = require("@cloud-ru/ds-button");
|
|
9
|
+
const modal_1 = require("@cloud-ru/ds-modal");
|
|
10
|
+
const tooltip_1 = require("@cloud-ru/ds-tooltip");
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const constants_1 = require("../../constants");
|
|
13
|
+
const helperComponents_1 = require("../../helperComponents");
|
|
14
|
+
const hooks_1 = require("../../hooks");
|
|
15
|
+
const locale_1 = require("../../locale");
|
|
16
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
17
|
+
function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content, confirmable = false, confirmText, hideConfirmCopyButton, subtitle, confirmTextVariant = constants_1.CONFIRM_TEXT_VARIANT.Name, ...rest }) {
|
|
18
|
+
const { t } = locale_1.modalPredefinedLocale.useTranslations();
|
|
19
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
20
|
+
const { value, error, handleChange, reset, validate } = (0, hooks_1.useTextFieldValidation)({
|
|
21
|
+
target: confirmable ? confirmText : undefined,
|
|
22
|
+
errorText: t('confirm.error'),
|
|
23
|
+
});
|
|
24
|
+
const shouldShowConfirm = Boolean(confirmable && confirmText);
|
|
25
|
+
const title = objectType ? t('deleteModal.title', { objectType }) : t('deleteModal.fallbackTitle');
|
|
26
|
+
const confirmPlaceholder = confirmTextVariant === constants_1.CONFIRM_TEXT_VARIANT.Text ? t('confirm.textPlaceholder') : t('confirm.namePlaceholder');
|
|
27
|
+
const handleClose = () => {
|
|
28
|
+
reset();
|
|
29
|
+
onClose();
|
|
30
|
+
};
|
|
31
|
+
const handleApproveClick = () => {
|
|
32
|
+
if (!validate()) {
|
|
33
|
+
inputRef.current?.focus();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
onDelete(handleClose);
|
|
37
|
+
};
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: modal_1.WIDTH.S, "data-test-id": constants_1.TEST_IDS.deleteModal, "data-confirmable": confirmable || undefined, ...rest, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.safeAreaTop }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Header, { title: title, subtitle: subtitle, slotAfterTitle: titleTooltip ? (0, jsx_runtime_1.jsx)(tooltip_1.QuestionTooltip, { size: 's', tip: titleTooltip }) : undefined }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Body, { className: styles_module_scss_1.default.body, content: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, children: [content ?? t('deleteModal.content'), shouldShowConfirm && ((0, jsx_runtime_1.jsx)(helperComponents_1.InputConfirm, { ref: inputRef, confirmText: confirmText ?? '', hideConfirmCopyButton: hideConfirmCopyButton, value: value, error: error, size: 'l', copyLineAlign: 'start', confirmLabel: t('deleteModal.confirmLabel'), placeholder: confirmPlaceholder, onChange: handleChange }))] }) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.safeAreaBottom }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Footer, { children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footer, children: [(0, jsx_runtime_1.jsx)(button_1.Button, { view: button_1.VIEW.Outline, appearance: button_1.APPEARANCE.Neutral, label: t('deleteModal.cancel'), onClick: handleClose, "data-test-id": constants_1.TEST_IDS.cancelButton }), (0, jsx_runtime_1.jsx)(button_1.Button, { view: button_1.VIEW.Filled, appearance: button_1.APPEARANCE.Critical, label: t('deleteModal.approve'), loading: deleting, onClick: handleApproveClick, "data-test-id": constants_1.TEST_IDS.approveButton })] }) })] }));
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DeleteModal';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DeleteModal"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.body{
|
|
18
|
+
min-height:auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.content{
|
|
22
|
+
display:flex;
|
|
23
|
+
flex-direction:column;
|
|
24
|
+
row-gap:var(--sn-primitive-dimension-16, 16px);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.footer{
|
|
28
|
+
display:flex;
|
|
29
|
+
-moz-column-gap:var(--sn-primitive-dimension-8, 8px);
|
|
30
|
+
column-gap:var(--sn-primitive-dimension-8, 8px);
|
|
31
|
+
justify-content:flex-end;
|
|
32
|
+
width:100%;
|
|
33
|
+
}
|