@cloud-ru/ds-ai-history-line 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/LICENSE +201 -0
- package/README.md +148 -2
- package/dist/cjs/components/AiHistoryLine/AiHistoryLine.d.ts +37 -0
- package/dist/cjs/components/AiHistoryLine/AiHistoryLine.js +33 -0
- package/dist/cjs/components/AiHistoryLine/index.d.ts +1 -0
- package/dist/cjs/components/AiHistoryLine/index.js +17 -0
- package/dist/cjs/components/AiHistoryLine/styles.module.css +7 -0
- package/dist/cjs/components/AiHistoryLineAccordion/AiHistoryLineAccordion.d.ts +21 -0
- package/dist/cjs/components/AiHistoryLineAccordion/AiHistoryLineAccordion.js +23 -0
- package/dist/cjs/components/AiHistoryLineAccordion/index.d.ts +1 -0
- package/dist/cjs/components/AiHistoryLineAccordion/index.js +17 -0
- package/dist/cjs/components/AiHistoryLineAccordion/styles.module.css +55 -0
- package/dist/cjs/components/AiHistoryLineAgentContent/AiHistoryLineAgentContent.d.ts +11 -0
- package/dist/cjs/components/AiHistoryLineAgentContent/AiHistoryLineAgentContent.js +15 -0
- package/dist/cjs/components/AiHistoryLineAgentContent/index.d.ts +1 -0
- package/dist/cjs/components/AiHistoryLineAgentContent/index.js +17 -0
- package/dist/cjs/components/AiHistoryLineAgentContent/styles.module.css +7 -0
- package/dist/cjs/components/AiHistoryLineCheckpoint/AiHistoryLineCheckpoint.d.ts +20 -0
- package/dist/cjs/components/AiHistoryLineCheckpoint/AiHistoryLineCheckpoint.js +18 -0
- package/dist/cjs/components/AiHistoryLineCheckpoint/index.d.ts +1 -0
- package/dist/cjs/components/AiHistoryLineCheckpoint/index.js +17 -0
- package/dist/cjs/components/AiHistoryLineCheckpoint/styles.module.css +38 -0
- package/dist/cjs/components/AiHistoryLineIndicator/AiHistoryLineIndicator.d.ts +21 -0
- package/dist/cjs/components/AiHistoryLineIndicator/AiHistoryLineIndicator.js +28 -0
- package/dist/cjs/components/AiHistoryLineIndicator/index.d.ts +1 -0
- package/dist/cjs/components/AiHistoryLineIndicator/index.js +17 -0
- package/dist/cjs/components/AiHistoryLineIndicator/styles.module.css +37 -0
- package/dist/cjs/components/AiHistoryLineItem/AiHistoryLineItem.d.ts +39 -0
- package/dist/cjs/components/AiHistoryLineItem/AiHistoryLineItem.js +47 -0
- package/dist/cjs/components/AiHistoryLineItem/index.d.ts +1 -0
- package/dist/cjs/components/AiHistoryLineItem/index.js +17 -0
- package/dist/cjs/components/AiHistoryLineItem/styles.module.css +13 -0
- package/dist/cjs/components/AiHistoryLineItem/useIndicatorOffset.d.ts +2 -0
- package/dist/cjs/components/AiHistoryLineItem/useIndicatorOffset.js +31 -0
- package/dist/cjs/components/AiHistoryLineItem/utils.d.ts +4 -0
- package/dist/cjs/components/AiHistoryLineItem/utils.js +78 -0
- package/dist/cjs/components/AiHistoryLineRequest/AiHistoryLineRequest.d.ts +18 -0
- package/dist/cjs/components/AiHistoryLineRequest/AiHistoryLineRequest.js +17 -0
- package/dist/cjs/components/AiHistoryLineRequest/index.d.ts +1 -0
- package/dist/cjs/components/AiHistoryLineRequest/index.js +17 -0
- package/dist/cjs/components/AiHistoryLineRequest/styles.module.css +34 -0
- package/dist/cjs/components/AiHistoryLineStepper/AiHistoryLineStepper.d.ts +21 -0
- package/dist/cjs/components/AiHistoryLineStepper/AiHistoryLineStepper.js +17 -0
- package/dist/cjs/components/AiHistoryLineStepper/index.d.ts +1 -0
- package/dist/cjs/components/AiHistoryLineStepper/index.js +17 -0
- package/dist/cjs/components/AiHistoryLineStepper/styles.module.css +29 -0
- package/dist/cjs/components/index.d.ts +8 -0
- package/dist/cjs/components/index.js +24 -0
- package/dist/cjs/constants.d.ts +18 -0
- package/dist/cjs/constants.js +21 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +220 -0
- package/dist/cjs/types.d.ts +4 -0
- package/dist/cjs/types.js +2 -0
- package/dist/esm/components/AiHistoryLine/AiHistoryLine.d.ts +37 -0
- package/dist/esm/components/AiHistoryLine/AiHistoryLine.js +27 -0
- package/dist/esm/components/AiHistoryLine/index.d.ts +1 -0
- package/dist/esm/components/AiHistoryLine/index.js +1 -0
- package/dist/esm/components/AiHistoryLine/styles.module.css +7 -0
- package/dist/esm/components/AiHistoryLineAccordion/AiHistoryLineAccordion.d.ts +21 -0
- package/dist/esm/components/AiHistoryLineAccordion/AiHistoryLineAccordion.js +17 -0
- package/dist/esm/components/AiHistoryLineAccordion/index.d.ts +1 -0
- package/dist/esm/components/AiHistoryLineAccordion/index.js +1 -0
- package/dist/esm/components/AiHistoryLineAccordion/styles.module.css +55 -0
- package/dist/esm/components/AiHistoryLineAgentContent/AiHistoryLineAgentContent.d.ts +11 -0
- package/dist/esm/components/AiHistoryLineAgentContent/AiHistoryLineAgentContent.js +9 -0
- package/dist/esm/components/AiHistoryLineAgentContent/index.d.ts +1 -0
- package/dist/esm/components/AiHistoryLineAgentContent/index.js +1 -0
- package/dist/esm/components/AiHistoryLineAgentContent/styles.module.css +7 -0
- package/dist/esm/components/AiHistoryLineCheckpoint/AiHistoryLineCheckpoint.d.ts +20 -0
- package/dist/esm/components/AiHistoryLineCheckpoint/AiHistoryLineCheckpoint.js +12 -0
- package/dist/esm/components/AiHistoryLineCheckpoint/index.d.ts +1 -0
- package/dist/esm/components/AiHistoryLineCheckpoint/index.js +1 -0
- package/dist/esm/components/AiHistoryLineCheckpoint/styles.module.css +38 -0
- package/dist/esm/components/AiHistoryLineIndicator/AiHistoryLineIndicator.d.ts +21 -0
- package/dist/esm/components/AiHistoryLineIndicator/AiHistoryLineIndicator.js +22 -0
- package/dist/esm/components/AiHistoryLineIndicator/index.d.ts +1 -0
- package/dist/esm/components/AiHistoryLineIndicator/index.js +1 -0
- package/dist/esm/components/AiHistoryLineIndicator/styles.module.css +37 -0
- package/dist/esm/components/AiHistoryLineItem/AiHistoryLineItem.d.ts +39 -0
- package/dist/esm/components/AiHistoryLineItem/AiHistoryLineItem.js +41 -0
- package/dist/esm/components/AiHistoryLineItem/index.d.ts +1 -0
- package/dist/esm/components/AiHistoryLineItem/index.js +1 -0
- package/dist/esm/components/AiHistoryLineItem/styles.module.css +13 -0
- package/dist/esm/components/AiHistoryLineItem/useIndicatorOffset.d.ts +2 -0
- package/dist/esm/components/AiHistoryLineItem/useIndicatorOffset.js +28 -0
- package/dist/esm/components/AiHistoryLineItem/utils.d.ts +4 -0
- package/dist/esm/components/AiHistoryLineItem/utils.js +74 -0
- package/dist/esm/components/AiHistoryLineRequest/AiHistoryLineRequest.d.ts +18 -0
- package/dist/esm/components/AiHistoryLineRequest/AiHistoryLineRequest.js +11 -0
- package/dist/esm/components/AiHistoryLineRequest/index.d.ts +1 -0
- package/dist/esm/components/AiHistoryLineRequest/index.js +1 -0
- package/dist/esm/components/AiHistoryLineRequest/styles.module.css +34 -0
- package/dist/esm/components/AiHistoryLineStepper/AiHistoryLineStepper.d.ts +21 -0
- package/dist/esm/components/AiHistoryLineStepper/AiHistoryLineStepper.js +11 -0
- package/dist/esm/components/AiHistoryLineStepper/index.d.ts +1 -0
- package/dist/esm/components/AiHistoryLineStepper/index.js +1 -0
- package/dist/esm/components/AiHistoryLineStepper/styles.module.css +29 -0
- package/dist/esm/components/index.d.ts +8 -0
- package/dist/esm/components/index.js +8 -0
- package/dist/esm/constants.d.ts +18 -0
- package/dist/esm/constants.js +18 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/style.css +220 -0
- package/dist/esm/types.d.ts +4 -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 +43 -3
- package/src/components/AiHistoryLine/AiHistoryLine.tsx +69 -0
- package/src/components/AiHistoryLine/index.ts +1 -0
- package/src/components/AiHistoryLine/styles.module.scss +9 -0
- package/src/components/AiHistoryLineAccordion/AiHistoryLineAccordion.tsx +72 -0
- package/src/components/AiHistoryLineAccordion/index.ts +1 -0
- package/src/components/AiHistoryLineAccordion/styles.module.scss +61 -0
- package/src/components/AiHistoryLineAgentContent/AiHistoryLineAgentContent.tsx +30 -0
- package/src/components/AiHistoryLineAgentContent/index.ts +1 -0
- package/src/components/AiHistoryLineAgentContent/styles.module.scss +10 -0
- package/src/components/AiHistoryLineCheckpoint/AiHistoryLineCheckpoint.tsx +57 -0
- package/src/components/AiHistoryLineCheckpoint/index.ts +1 -0
- package/src/components/AiHistoryLineCheckpoint/styles.module.scss +38 -0
- package/src/components/AiHistoryLineIndicator/AiHistoryLineIndicator.tsx +69 -0
- package/src/components/AiHistoryLineIndicator/index.ts +1 -0
- package/src/components/AiHistoryLineIndicator/styles.module.scss +45 -0
- package/src/components/AiHistoryLineItem/AiHistoryLineItem.tsx +140 -0
- package/src/components/AiHistoryLineItem/index.ts +1 -0
- package/src/components/AiHistoryLineItem/styles.module.scss +17 -0
- package/src/components/AiHistoryLineItem/useIndicatorOffset.ts +42 -0
- package/src/components/AiHistoryLineItem/utils.ts +95 -0
- package/src/components/AiHistoryLineRequest/AiHistoryLineRequest.tsx +54 -0
- package/src/components/AiHistoryLineRequest/index.ts +1 -0
- package/src/components/AiHistoryLineRequest/styles.module.scss +30 -0
- package/src/components/AiHistoryLineStepper/AiHistoryLineStepper.tsx +55 -0
- package/src/components/AiHistoryLineStepper/index.ts +1 -0
- package/src/components/AiHistoryLineStepper/styles.module.scss +32 -0
- package/src/components/index.ts +8 -0
- package/src/constants.ts +18 -0
- package/src/index.ts +3 -0
- package/src/types.ts +7 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 1.1.0 (2026-11-02)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **AIX-487:** ai-history-line component ([8f9d550](https://github.com/cloud-ru-tech/snack-v2/commit/8f9d550beb53b91d945816e48b6a280c3ad677b8))
|
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
CHANGED
|
@@ -1,3 +1,149 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AiHistoryLine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@cloud-ru/ds-ai-history-line` — Вертикальная лента шагов AI-диалога — запросы пользователя, ответы агента, вызовы инструментов, чекпоинты
|
|
4
|
+
|
|
5
|
+
Вертикальная лента шагов AI-диалога — запросы пользователя, ответы агента, вызовы инструментов, чекпоинты
|
|
6
|
+
|
|
7
|
+
## Когда использовать
|
|
8
|
+
|
|
9
|
+
Вертикальная лента событий: запрос, ответ, группа вызовов, чекпоинт. Содержимое строки передаёт потребитель. Индикатор, степпер, запрос, аккордеон и чекпоинт можно поставить и отдельно от ленты. Карточка группы раскрывается сама. Уже показанную группу раскрывают снаружи через `open` и `onOpenChange`. Кольцо в ленте одно: его `id` задают `value` или `defaultValue`. Клик по индикатору с `id` переключает это кольцо. Запись адреса и прокрутку к строке делает потребитель в `onIndicatorClick`.
|
|
10
|
+
|
|
11
|
+
## Анатомия
|
|
12
|
+
|
|
13
|
+
- `AiHistoryLine` — список, `ul`.
|
|
14
|
+
- `AiHistoryLine.Item` — строка: степпер, индикатор и слот тела.
|
|
15
|
+
- `AiHistoryLine.Indicator` — колодец 24×24. `background={false}` убирает подложку у аватара. Кольцо задаёт `active`, своё состояние выбора компонент не хранит.
|
|
16
|
+
- `AiHistoryLine.Stepper` — верхний и нижний коннекторы вокруг индикатора. Высоту верхней линии задаёт `offset`. `showLeadingConnector={false}` скрывает линию и сохраняет место. Нижняя линия есть при `showClosingConnector`. В ленте смещение считает строка: центр кружка совпадает с центром первой строки, у первой строки линия не видна.
|
|
17
|
+
- `AiHistoryLine.AgentContent` — обёртка ответа агента: отступ сверху и расстояние между соседними блоками.
|
|
18
|
+
- `AiHistoryLine.Request`, `AiHistoryLine.Accordion`, `AiHistoryLine.Checkpoint` — карточки. Аккордеон хранит раскрытие внутри себя, а `open` и `onOpenChange` передают его наружу.
|
|
19
|
+
|
|
20
|
+
## Установка
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm add @cloud-ru/ds-ai-history-line
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { AiHistoryLine } from '@cloud-ru/ds-ai-history-line'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Props
|
|
31
|
+
|
|
32
|
+
**AiHistoryLineProps**
|
|
33
|
+
|
|
34
|
+
| Prop | Type | Default | Description |
|
|
35
|
+
|------|------|---------|-------------|
|
|
36
|
+
| `as` | `ElementType` | — | Полиморфный тег корня. По умолчанию `ul`. |
|
|
37
|
+
| `children` | `ReactNode` | — | Элементы ленты. |
|
|
38
|
+
| `className` | `string` | — | Дополнительный класс корня. |
|
|
39
|
+
| `data-test-id` | `string` | — | |
|
|
40
|
+
| `defaultValue` | `string` | — | `id` индикатора, выбранного при первом рендере. |
|
|
41
|
+
| `innerRef` | `PolymorphicRef` | — | Ref на корневой элемент. |
|
|
42
|
+
| `onIndicatorChange` | `((value: string) => void)` | — | Сообщает `id` выбранного индикатора. Повторный клик по нему передаёт `undefined`. |
|
|
43
|
+
| `value` | `string` | — | `id` выбранного индикатора. Вместе с `onIndicatorChange` выбор управляемый. |
|
|
44
|
+
|
|
45
|
+
## AiHistoryLineAccordion
|
|
46
|
+
|
|
47
|
+
### Props `AiHistoryLineAccordionProps`
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Default | Description |
|
|
50
|
+
|------|------|---------|-------------|
|
|
51
|
+
| `children` | `ReactNode` | — | Слот содержимого. Статус каждой строки задаёт сам ребёнок. |
|
|
52
|
+
| `className` | `string` | — | Дополнительный класс корня. |
|
|
53
|
+
| `data-test-id` | `string` | `ai-history-line-accordion` | |
|
|
54
|
+
| `defaultOpen` | `boolean` | `false` | Карточка раскрыта при первом рендере. |
|
|
55
|
+
| `id` | `string` | — | Идентификатор карточки. |
|
|
56
|
+
| `innerRef` | `Ref<HTMLDivElement>` | — | Ref на корень карточки, не на кнопку. |
|
|
57
|
+
| `onOpenChange` | `((open: boolean) => void)` | — | Сообщает новое раскрытие после клика или клавиши. |
|
|
58
|
+
| `open` | `boolean` | — | Раскрытие уже показанной карточки. Вместе с `onOpenChange` состояние управляемое. |
|
|
59
|
+
| `title` | `string` | — | Подпись кнопки раскрытия. Число вызовов и пометку об ошибке собирает продукт. |
|
|
60
|
+
|
|
61
|
+
## AiHistoryLineAgentContent
|
|
62
|
+
|
|
63
|
+
### Props `AiHistoryLineAgentContentProps`
|
|
64
|
+
|
|
65
|
+
| Prop | Type | Default | Description |
|
|
66
|
+
|------|------|---------|-------------|
|
|
67
|
+
| `children` | `ReactNode` | — | Блоки ответа. Расстояние задаётся между соседними блоками. |
|
|
68
|
+
| `className` | `string` | — | Дополнительный класс корня. |
|
|
69
|
+
| `data-test-id` | `string` | `ai-history-line-agent-content` | |
|
|
70
|
+
| `innerRef` | `Ref<HTMLDivElement>` | — | Ref на корневой элемент. |
|
|
71
|
+
|
|
72
|
+
## AiHistoryLineCheckpoint
|
|
73
|
+
|
|
74
|
+
### Props `AiHistoryLineCheckpointProps`
|
|
75
|
+
|
|
76
|
+
| Prop | Type | Default | Description |
|
|
77
|
+
|------|------|---------|-------------|
|
|
78
|
+
| `added` | `number` | — | Количество добавленных строк. Целое неотрицательное число, знак `+` ставит `AiCodeDiff`. |
|
|
79
|
+
| `as` | `ElementType` | — | Полиморфный тег корня. По умолчанию `div`. |
|
|
80
|
+
| `className` | `string` | — | Дополнительный класс корня. |
|
|
81
|
+
| `data-test-id` | `string` | `ai-history-line-checkpoint` | |
|
|
82
|
+
| `hash` | `string` | — | Короткий идентификатор коммита. |
|
|
83
|
+
| `innerRef` | `PolymorphicRef` | — | Ref на корневой элемент. |
|
|
84
|
+
| `removed` | `number` | — | Количество удалённых строк. Целое неотрицательное число, знак `-` ставит `AiCodeDiff`. |
|
|
85
|
+
| `title` | `string` | — | Текст коммита. |
|
|
86
|
+
|
|
87
|
+
## AiHistoryLineIndicator
|
|
88
|
+
|
|
89
|
+
### Props `AiHistoryLineIndicatorProps`
|
|
90
|
+
|
|
91
|
+
| Prop | Type | Default | Description |
|
|
92
|
+
|------|------|---------|-------------|
|
|
93
|
+
| `active` | `boolean` | `false` | Кольцо выбора. Компонент его не переключает. |
|
|
94
|
+
| `background` | `boolean` | `true` | Подложка колодца. `false` убирает заливку и внутреннюю обводку, кольцо выбора остаётся. |
|
|
95
|
+
| `children` | `ReactNode` | — | Содержимое колодца 24×24: аватар или иконка. |
|
|
96
|
+
| `className` | `string` | — | Дополнительный класс корня. |
|
|
97
|
+
| `data-test-id` | `string` | `ai-history-line__indicator` | |
|
|
98
|
+
| `href` | `string` | — | Делает индикатор ссылкой. Переход выполняет потребитель. |
|
|
99
|
+
| `indicatorLabel` | `string` | — | Доступное имя кнопки или ссылки. |
|
|
100
|
+
| `innerRef` | `Ref<HTMLButtonElement \| HTMLAnchorElement \| HTMLSpanElement>` | — | Ref на корневой элемент. |
|
|
101
|
+
| `onClick` | `MouseEventHandler<HTMLButtonElement \| HTMLAnchorElement>` | — | Клик по индикатору. Без `href` рендерит кнопку. |
|
|
102
|
+
|
|
103
|
+
## AiHistoryLineItem
|
|
104
|
+
|
|
105
|
+
### Props `AiHistoryLineItemProps`
|
|
106
|
+
|
|
107
|
+
| Prop | Type | Default | Description |
|
|
108
|
+
|------|------|---------|-------------|
|
|
109
|
+
| `as` | `ElementType` | — | Полиморфный тег корня. По умолчанию `li`. |
|
|
110
|
+
| `children` | `ReactNode` | — | Тело строки. |
|
|
111
|
+
| `className` | `string` | — | Дополнительный класс корня. |
|
|
112
|
+
| `data-test-id` | `string` | `ai-history-line__item` | |
|
|
113
|
+
| `firstItem` | `boolean` | — | Первая строка. Верхний коннектор остаётся и держит смещение, линия не видна. |
|
|
114
|
+
| `href` | `string` | — | Делает индикатор ссылкой. <br/> Переход, запись адреса и прокрутка остаются на стороне потребителя. |
|
|
115
|
+
| `id` | `string` | — | Значение в группе активного индикатора. С `id` индикатор становится кнопкой выбора. |
|
|
116
|
+
| `indicator` | `ReactNode` | — | Узел в колодце 24×24. Иконку собирает потребитель. |
|
|
117
|
+
| `indicatorBackground` | `boolean` | `true` | Подложка индикатора. `false` для аватара: без заливки и внутренней обводки. |
|
|
118
|
+
| `indicatorLabel` | `string` | — | Доступное имя интерактивного индикатора. <br/> Имеет смысл у кнопки выбора (`id`) и у ссылки (`href`). |
|
|
119
|
+
| `innerRef` | `PolymorphicRef` | — | Ref на корневой элемент. |
|
|
120
|
+
| `lastItem` | `boolean` | — | Последняя строка. Нижний коннектор скрыт. |
|
|
121
|
+
| `onIndicatorClick` | `MouseEventHandler<HTMLButtonElement \| HTMLAnchorElement>` | — | Дополнительный обработчик клика. <br/> Сюда потребитель ставит запись хеша и прокрутку, если они нужны. |
|
|
122
|
+
|
|
123
|
+
## AiHistoryLineRequest
|
|
124
|
+
|
|
125
|
+
### Props `AiHistoryLineRequestProps`
|
|
126
|
+
|
|
127
|
+
| Prop | Type | Default | Description |
|
|
128
|
+
|------|------|---------|-------------|
|
|
129
|
+
| `as` | `ElementType` | — | Полиморфный тег корня. По умолчанию `div`. |
|
|
130
|
+
| `children` | `ReactNode` | — | Текст запроса. Переносится по ширине, лимита строк нет. |
|
|
131
|
+
| `className` | `string` | — | Дополнительный класс корня. |
|
|
132
|
+
| `data-test-id` | `string` | `ai-history-line-request` | |
|
|
133
|
+
| `duration` | `string` | — | Уже отформатированная длительность. Нет значения — скрыты и длительность, и разделитель. |
|
|
134
|
+
| `innerRef` | `PolymorphicRef` | — | Ref на корневой элемент. |
|
|
135
|
+
| `timestamp` | `string` | — | Уже отформатированные дата и время. |
|
|
136
|
+
|
|
137
|
+
## AiHistoryLineStepper
|
|
138
|
+
|
|
139
|
+
### Props `AiHistoryLineStepperProps`
|
|
140
|
+
|
|
141
|
+
| Prop | Type | Default | Description |
|
|
142
|
+
|------|------|---------|-------------|
|
|
143
|
+
| `children` | `ReactNode` | — | Индикатор между коннекторами. |
|
|
144
|
+
| `className` | `string` | — | Дополнительный класс корня. |
|
|
145
|
+
| `data-test-id` | `string` | `ai-history-line__stepper` | |
|
|
146
|
+
| `innerRef` | `Ref<HTMLDivElement>` | — | Ref на корневой элемент. |
|
|
147
|
+
| `offset` | `Height<string \| number>` | — | Высота верхнего коннектора. <br/> Число — пиксели, строка — CSS-длина. <br/> Нет значения и `0` — коннектор не рендерится. |
|
|
148
|
+
| `showClosingConnector` | `boolean` | — | Показать нижний коннектор. |
|
|
149
|
+
| `showLeadingConnector` | `boolean` | — | Показать верхний коннектор. `false` — слот остаётся и держит `offset`, линия скрыта. |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PolymorphicRef } from '@cloud-ru/ds-utils';
|
|
2
|
+
import { ElementType, ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { PolymorphicProps } from '../../types';
|
|
4
|
+
import { AiHistoryLineAccordion } from '../AiHistoryLineAccordion';
|
|
5
|
+
import { AiHistoryLineAgentContent } from '../AiHistoryLineAgentContent';
|
|
6
|
+
import { AiHistoryLineCheckpoint } from '../AiHistoryLineCheckpoint';
|
|
7
|
+
import { AiHistoryLineIndicator } from '../AiHistoryLineIndicator';
|
|
8
|
+
import { AiHistoryLineItem } from '../AiHistoryLineItem';
|
|
9
|
+
import { AiHistoryLineRequest } from '../AiHistoryLineRequest';
|
|
10
|
+
import { AiHistoryLineStepper } from '../AiHistoryLineStepper';
|
|
11
|
+
export type AiHistoryLineProps<T extends ElementType = 'ol'> = PolymorphicProps<T, {
|
|
12
|
+
/** Элементы ленты. */
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/** `id` выбранного индикатора. Вместе с `onIndicatorChange` выбор управляемый. */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** `id` индикатора, выбранного при первом рендере. */
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
/** Сообщает `id` выбранного индикатора. Повторный клик по нему передаёт `undefined`. */
|
|
19
|
+
onIndicatorChange?(value: string | undefined): void;
|
|
20
|
+
/** Дополнительный класс корня. */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Полиморфный тег корня. По умолчанию `ul`. */
|
|
23
|
+
as?: T;
|
|
24
|
+
/** Ref на корневой элемент. */
|
|
25
|
+
innerRef?: PolymorphicRef<T>;
|
|
26
|
+
}>;
|
|
27
|
+
declare function AiHistoryLineRoot<T extends ElementType = 'ol'>({ as, value, defaultValue, onIndicatorChange, innerRef, className, children, 'data-test-id': dataTestId, ...rest }: AiHistoryLineProps<T>): ReactElement;
|
|
28
|
+
export declare const AiHistoryLine: typeof AiHistoryLineRoot & {
|
|
29
|
+
Item: typeof AiHistoryLineItem;
|
|
30
|
+
Indicator: typeof AiHistoryLineIndicator;
|
|
31
|
+
Stepper: typeof AiHistoryLineStepper;
|
|
32
|
+
AgentContent: typeof AiHistoryLineAgentContent;
|
|
33
|
+
Request: typeof AiHistoryLineRequest;
|
|
34
|
+
Accordion: typeof AiHistoryLineAccordion;
|
|
35
|
+
Checkpoint: typeof AiHistoryLineCheckpoint;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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.AiHistoryLine = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const toggles_1 = require("@cloud-ru/ds-toggles");
|
|
9
|
+
const utils_1 = require("@cloud-ru/ds-utils");
|
|
10
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
11
|
+
const constants_1 = require("../../constants");
|
|
12
|
+
const AiHistoryLineAccordion_1 = require("../AiHistoryLineAccordion");
|
|
13
|
+
const AiHistoryLineAgentContent_1 = require("../AiHistoryLineAgentContent");
|
|
14
|
+
const AiHistoryLineCheckpoint_1 = require("../AiHistoryLineCheckpoint");
|
|
15
|
+
const AiHistoryLineIndicator_1 = require("../AiHistoryLineIndicator");
|
|
16
|
+
const AiHistoryLineItem_1 = require("../AiHistoryLineItem");
|
|
17
|
+
const AiHistoryLineRequest_1 = require("../AiHistoryLineRequest");
|
|
18
|
+
const AiHistoryLineStepper_1 = require("../AiHistoryLineStepper");
|
|
19
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
20
|
+
function AiHistoryLineRoot({ as, value, defaultValue, onIndicatorChange, innerRef, className, children, 'data-test-id': dataTestId = constants_1.TEST_IDS.root, ...rest }) {
|
|
21
|
+
const Component = (as || 'ul');
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(toggles_1.ToggleGroup, { selectionMode: 'single', value: value, defaultValue: defaultValue, onChange: onIndicatorChange, children: (0, jsx_runtime_1.jsx)(Component, { ...rest, ref: innerRef, className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), "data-test-id": dataTestId, children: children }) }));
|
|
23
|
+
}
|
|
24
|
+
(0, utils_1.withInnerRefSupport)(AiHistoryLineRoot);
|
|
25
|
+
exports.AiHistoryLine = Object.assign(AiHistoryLineRoot, {
|
|
26
|
+
Item: AiHistoryLineItem_1.AiHistoryLineItem,
|
|
27
|
+
Indicator: AiHistoryLineIndicator_1.AiHistoryLineIndicator,
|
|
28
|
+
Stepper: AiHistoryLineStepper_1.AiHistoryLineStepper,
|
|
29
|
+
AgentContent: AiHistoryLineAgentContent_1.AiHistoryLineAgentContent,
|
|
30
|
+
Request: AiHistoryLineRequest_1.AiHistoryLineRequest,
|
|
31
|
+
Accordion: AiHistoryLineAccordion_1.AiHistoryLineAccordion,
|
|
32
|
+
Checkpoint: AiHistoryLineCheckpoint_1.AiHistoryLineCheckpoint,
|
|
33
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AiHistoryLine';
|
|
@@ -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("./AiHistoryLine"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/ds-utils';
|
|
2
|
+
import { ReactNode, Ref } from 'react';
|
|
3
|
+
export type AiHistoryLineAccordionProps = WithSupportProps<{
|
|
4
|
+
/** Идентификатор карточки. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Карточка раскрыта при первом рендере. */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Раскрытие уже показанной карточки. Вместе с `onOpenChange` состояние управляемое. */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/** Сообщает новое раскрытие после клика или клавиши. */
|
|
11
|
+
onOpenChange?(open: boolean): void;
|
|
12
|
+
/** Подпись кнопки раскрытия. Число вызовов и пометку об ошибке собирает продукт. */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Слот содержимого. Статус каждой строки задаёт сам ребёнок. */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/** Дополнительный класс корня. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Ref на корень карточки, не на кнопку. */
|
|
19
|
+
innerRef?: Ref<HTMLDivElement>;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function AiHistoryLineAccordion({ id, defaultOpen, open, onOpenChange, title, children, className, innerRef, 'data-test-id': dataTestId, }: AiHistoryLineAccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
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.AiHistoryLineAccordion = AiHistoryLineAccordion;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const system_1 = require("@cloud-ru/ds-icons/interface/system");
|
|
9
|
+
const utils_1 = require("@cloud-ru/ds-utils");
|
|
10
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const constants_1 = require("../../constants");
|
|
13
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
14
|
+
function AiHistoryLineAccordion({ id, defaultOpen = false, open, onOpenChange, title, children, className, innerRef, 'data-test-id': dataTestId = constants_1.TEST_IDS.accordion, }) {
|
|
15
|
+
const contentId = (0, react_1.useId)();
|
|
16
|
+
const [isOpen, setIsOpen] = (0, utils_1.useUncontrolledProp)(open, defaultOpen, onOpenChange);
|
|
17
|
+
const handleToggle = (0, react_1.useCallback)(() => {
|
|
18
|
+
setIsOpen(!isOpen);
|
|
19
|
+
}, [isOpen, setIsOpen]);
|
|
20
|
+
const Chevron = isOpen ? system_1.ChevronUpSVG : system_1.ChevronDownSVG;
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: innerRef, className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), "data-test-id": dataTestId, "data-open": isOpen ? 'true' : 'false', "data-accordion-id": id, children: [(0, jsx_runtime_1.jsxs)("button", { type: 'button', className: styles_module_scss_1.default.header, onClick: handleToggle, "aria-expanded": isOpen, "aria-controls": contentId, "data-test-id": constants_1.TEST_IDS.accordionHeader, children: [(0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.title, children: title }), (0, jsx_runtime_1.jsx)(Chevron, { className: styles_module_scss_1.default.chevron, size: 24, "aria-hidden": true })] }), (0, jsx_runtime_1.jsx)("div", { id: contentId, className: styles_module_scss_1.default.content, hidden: !isOpen, "data-test-id": constants_1.TEST_IDS.accordionContent, children: children })] }));
|
|
22
|
+
}
|
|
23
|
+
(0, utils_1.withInnerRefSupport)(AiHistoryLineAccordion);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AiHistoryLineAccordion';
|
|
@@ -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("./AiHistoryLineAccordion"), exports);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.root{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
gap:var(--sn-primitive-dimension-10, 10px);
|
|
5
|
+
min-width:0;
|
|
6
|
+
padding:var(--sn-primitive-dimension-8, 8px) var(--sn-primitive-dimension-12, 12px);
|
|
7
|
+
border:var(--sn-primitive-strokeWeight-strokeRegular, 1px) solid var(--sn-theme-color-neutral-decor, var(--sn-brand-color-neutral-80, var(--sn-brand-palette-gray-80, #e2e2e2)));
|
|
8
|
+
border-radius:var(--sn-density-radius-s, var(--sn-platform-comfort-radius-s, var(--sn-primitive-dimension-12, 12px)));
|
|
9
|
+
background:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-brand-palette-gray-95, #ffffff)));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.header{
|
|
13
|
+
cursor:pointer;
|
|
14
|
+
display:flex;
|
|
15
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
16
|
+
align-items:center;
|
|
17
|
+
justify-content:space-between;
|
|
18
|
+
width:100%;
|
|
19
|
+
padding:0;
|
|
20
|
+
border:0;
|
|
21
|
+
color:inherit;
|
|
22
|
+
text-align:left;
|
|
23
|
+
background:none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.title{
|
|
27
|
+
font-family:var(--sn-regular-body-m-fontFamily, var(--sn-brand-font-fontFamily-regular-body, SB Sans Text));
|
|
28
|
+
font-weight:var(--sn-regular-body-m-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-m, var(--sn-brand-font-fontWeight-light-regular-body-m, var(--sn-primitive-font-fontWeightValue-400, 400))));
|
|
29
|
+
line-height:var(--sn-regular-body-m-lineHeight, var(--sn-density-typography-roleBody-lineHeightM, var(--sn-platform-comfort-typography-roleBody-lineHeightM, var(--sn-primitive-font-lineHeight-24, 24px))));
|
|
30
|
+
font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-platform-comfort-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px))));
|
|
31
|
+
letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
|
|
32
|
+
paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
|
|
33
|
+
flex:1 1 auto;
|
|
34
|
+
min-width:0;
|
|
35
|
+
color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #000000));
|
|
36
|
+
overflow-wrap:anywhere;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.chevron{
|
|
40
|
+
flex-shrink:0;
|
|
41
|
+
width:var(--sn-primitive-dimension-24, 24px);
|
|
42
|
+
height:var(--sn-primitive-dimension-24, 24px);
|
|
43
|
+
color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(0, 0, 0, 0.5803921569)));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.content{
|
|
47
|
+
display:flex;
|
|
48
|
+
flex-direction:column;
|
|
49
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
50
|
+
min-width:0;
|
|
51
|
+
padding-bottom:var(--sn-primitive-dimension-8, 8px);
|
|
52
|
+
}
|
|
53
|
+
.content[hidden]{
|
|
54
|
+
display:none;
|
|
55
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/ds-utils';
|
|
2
|
+
import { ReactElement, ReactNode, Ref } from 'react';
|
|
3
|
+
export type AiHistoryLineAgentContentProps = WithSupportProps<{
|
|
4
|
+
/** Блоки ответа. Расстояние задаётся между соседними блоками. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** Дополнительный класс корня. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Ref на корневой элемент. */
|
|
9
|
+
innerRef?: Ref<HTMLDivElement>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function AiHistoryLineAgentContent({ children, className, innerRef, 'data-test-id': dataTestId, }: AiHistoryLineAgentContentProps): ReactElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
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.AiHistoryLineAgentContent = AiHistoryLineAgentContent;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const utils_1 = require("@cloud-ru/ds-utils");
|
|
9
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
const constants_1 = require("../../constants");
|
|
11
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
12
|
+
function AiHistoryLineAgentContent({ children, className, innerRef, 'data-test-id': dataTestId = constants_1.TEST_IDS.agentContent, }) {
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: innerRef, className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), "data-test-id": dataTestId, children: children }));
|
|
14
|
+
}
|
|
15
|
+
(0, utils_1.withInnerRefSupport)(AiHistoryLineAgentContent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AiHistoryLineAgentContent';
|