@epam/ai-dial-ui-kit 0.1.0-rc
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/LICENSE +201 -0
- package/README.md +292 -0
- package/dist/dial-ui-kit.cjs.js +22 -0
- package/dist/dial-ui-kit.es.js +778 -0
- package/dist/index.css +2 -0
- package/dist/src/__mocks__/monaco-editor.d.ts +13 -0
- package/dist/src/components/Button/Button.d.ts +36 -0
- package/dist/src/components/ErrorText/ErrorText.d.ts +15 -0
- package/dist/src/components/Field/Field.d.ts +24 -0
- package/dist/src/components/Icon/Icon.d.ts +18 -0
- package/dist/src/components/Input/Input.d.ts +44 -0
- package/dist/src/components/InputField/InputField.d.ts +92 -0
- package/dist/src/components/JsonEditor/JsonEditor.d.ts +24 -0
- package/dist/src/components/TextAreaField/TextAreaField.d.ts +39 -0
- package/dist/src/components/Textarea/Textarea.d.ts +34 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +31 -0
- package/dist/src/components/Tooltip/TooltipContainer.d.ts +18 -0
- package/dist/src/components/Tooltip/TooltipContent.d.ts +8 -0
- package/dist/src/components/Tooltip/TooltipContext.d.ts +105 -0
- package/dist/src/components/Tooltip/TooltipTrigger.d.ts +10 -0
- package/dist/src/constants/editor.d.ts +2 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/models/field-control-props.d.ts +21 -0
- package/dist/src/types/editor.d.ts +10 -0
- package/package.json +113 -0
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 EPAM Systems, Inc.
|
|
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,292 @@
|
|
|
1
|
+
# AI DIAL UI Kit
|
|
2
|
+
|
|
3
|
+
[<img align="right" width="120" height="120"
|
|
4
|
+
alt="AI-DIAL-UI-KIT project logo"
|
|
5
|
+
src="https://avatars.githubusercontent.com/u/1589802?s=200&v=4"
|
|
6
|
+
/>](#)
|
|
7
|
+
|
|
8
|
+
A comprehensive React-based UI components library specifically designed for building AI-driven applications with modern standards and enterprise-grade quality.
|
|
9
|
+
|
|
10
|
+
[](https://badge.fury.io/js/@epam%2Fai-dial-ui-kit)
|
|
11
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
12
|
+
[](https://www.typescriptlang.org/)
|
|
13
|
+
[](https://reactjs.org/)
|
|
14
|
+
|
|
15
|
+
## Table of Contents
|
|
16
|
+
|
|
17
|
+
- [✨ Features](#-features)
|
|
18
|
+
- [📖 Documentation](#-documentation)
|
|
19
|
+
- [🚀 Quick Start](#-quick-start)
|
|
20
|
+
- [Prerequisites](#prerequisites)
|
|
21
|
+
- [Installation](#installation)
|
|
22
|
+
- [Basic Usage](#basic-usage)
|
|
23
|
+
- [Development](#development)
|
|
24
|
+
- [Prerequisites](#prerequisites-1)
|
|
25
|
+
- [Development Setup](#development-setup)
|
|
26
|
+
- [Project Structure](#project-structure)
|
|
27
|
+
- [🎨 Theming & Customization](#-theming--customization)
|
|
28
|
+
- [📖 Storybook](#-storybook)
|
|
29
|
+
- [Development Mode](#development-mode)
|
|
30
|
+
- [Production Build](#production-build)
|
|
31
|
+
- [🚀 Usage in Projects](#-usage-in-projects)
|
|
32
|
+
- [Next.js Integration](#nextjs-integration)
|
|
33
|
+
- [Vite Integration](#vite-integration)
|
|
34
|
+
- [Tree Shaking](#tree-shaking)
|
|
35
|
+
- [🤝 Contributing](#-contributing)
|
|
36
|
+
- [🔒 Security](#-security)
|
|
37
|
+
- [📄 License](#-license)
|
|
38
|
+
- [🌟 Related Projects](#-related-projects)
|
|
39
|
+
|
|
40
|
+
## ✨ Features
|
|
41
|
+
|
|
42
|
+
- 🎨 **Unified User Experience**: Consistent design language for all AI DIAL applications
|
|
43
|
+
- ⚡ **Modern Stack**: Built with latest React, TypeScript, Vite, and Tailwind CSS
|
|
44
|
+
- 🎨 **Highly Customizable**: Deep theming capabilities with CSS custom properties
|
|
45
|
+
- 🧪 **Well-Tested**: Comprehensive test coverage (70%+) with Vitest and React Testing Library
|
|
46
|
+
- 📚 **Storybook Ready**: Interactive component documentation and development playground
|
|
47
|
+
- 🛠️ **Developer Experience**: ESLint, Prettier, Husky for maintainable code quality
|
|
48
|
+
- 📦 **Distribution Ready**: NPM package ready for easy integration
|
|
49
|
+
|
|
50
|
+
## 📖 Documentation
|
|
51
|
+
|
|
52
|
+
Explore our components and their usage in our interactive [Storybook documentation](http://localhost:6006).
|
|
53
|
+
|
|
54
|
+
## 🚀 Quick Start
|
|
55
|
+
|
|
56
|
+
### Prerequisites
|
|
57
|
+
|
|
58
|
+
- Node.js >= 22.2.0
|
|
59
|
+
- npm >= 10.7.0
|
|
60
|
+
|
|
61
|
+
### Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install @epam/ai-dial-ui-kit
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Basic Usage
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { DialButton } from '@epam/ai-dial-ui-kit';
|
|
71
|
+
import '@epam/ai-dial-ui-kit/styles.css';
|
|
72
|
+
|
|
73
|
+
function App() {
|
|
74
|
+
return (
|
|
75
|
+
<div>
|
|
76
|
+
<DialButton
|
|
77
|
+
cssClass="dial-primary-button"
|
|
78
|
+
onClick={() => alert('Hello AI DIAL!')}
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Development
|
|
86
|
+
|
|
87
|
+
### Prerequisites
|
|
88
|
+
|
|
89
|
+
- Node.js >= 22.2.0
|
|
90
|
+
- npm >= 10.7.0
|
|
91
|
+
- Git
|
|
92
|
+
|
|
93
|
+
### Development Setup
|
|
94
|
+
|
|
95
|
+
1. **Fork and Clone**
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://github.com/your-username/ai-dial-ui-kit.git
|
|
98
|
+
cd ai-dial-ui-kit
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
2. **Install Dependencies**
|
|
102
|
+
```bash
|
|
103
|
+
npm install
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
3. **Start Development Environment**
|
|
107
|
+
```bash
|
|
108
|
+
# Start Storybook for component development
|
|
109
|
+
npm run storybook
|
|
110
|
+
|
|
111
|
+
# Run tests in watch mode
|
|
112
|
+
npm run test -- --watch
|
|
113
|
+
|
|
114
|
+
# Start Vite dev server
|
|
115
|
+
npm run dev
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Running Tests
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Run all tests with coverage
|
|
122
|
+
npm run test
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Project Structure
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
src/
|
|
129
|
+
├── components/ # React components
|
|
130
|
+
│ ├── Button/ # Example component
|
|
131
|
+
│ │ ├── Button.tsx
|
|
132
|
+
│ │ ├── Button.spec.tsx
|
|
133
|
+
│ │ └── Button.stories.tsx
|
|
134
|
+
│ └── ...
|
|
135
|
+
├── styles/ # Global styles and Tailwind configuration
|
|
136
|
+
│ ├── buttons.scss
|
|
137
|
+
│ ├── typography.scss
|
|
138
|
+
│ └── tailwind-entry.scss
|
|
139
|
+
├── types/ # TypeScript type definitions
|
|
140
|
+
└── index.ts # Main entry point
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## 🎨 Theming & Customization
|
|
144
|
+
|
|
145
|
+
The library uses CSS custom properties for comprehensive theming. Override these variables to match your brand:
|
|
146
|
+
|
|
147
|
+
```css
|
|
148
|
+
:root {
|
|
149
|
+
/* Background layers */
|
|
150
|
+
--bg-layer-0: #000000;
|
|
151
|
+
--bg-layer-1: #090D13;
|
|
152
|
+
--bg-layer-2: #171B21;
|
|
153
|
+
|
|
154
|
+
/* Text colors */
|
|
155
|
+
--text-primary: #F3F4F6;
|
|
156
|
+
--text-secondary: #9CA3AF;
|
|
157
|
+
--text-tertiary: #6B7280;
|
|
158
|
+
...
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Full list of variables is available [here](tailwind.config.js)
|
|
163
|
+
|
|
164
|
+
## 📖 Storybook
|
|
165
|
+
|
|
166
|
+
Storybook is a frontend workshop for building UI components and pages in isolation.
|
|
167
|
+
|
|
168
|
+
### Stories
|
|
169
|
+
To run fully interactive storybook:
|
|
170
|
+
|
|
171
|
+
#### Development mode
|
|
172
|
+
```bash
|
|
173
|
+
npm run storybook
|
|
174
|
+
# Open http://localhost:6006
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### Production Build
|
|
178
|
+
```bash
|
|
179
|
+
npm run build-storybook
|
|
180
|
+
```
|
|
181
|
+
#### Production start
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npx http-server ./storybook-static
|
|
185
|
+
# Open http://127.0.0.1:8080/
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Documents
|
|
189
|
+
To run documents only:
|
|
190
|
+
|
|
191
|
+
#### Development mode
|
|
192
|
+
``` bash
|
|
193
|
+
npm run storybook-docs
|
|
194
|
+
# Open http://localhost:54800/
|
|
195
|
+
```
|
|
196
|
+
#### Production build
|
|
197
|
+
```bash
|
|
198
|
+
npm run build-storybook-docs
|
|
199
|
+
```
|
|
200
|
+
#### Production start
|
|
201
|
+
```bash
|
|
202
|
+
npx http-server ./storybook-static
|
|
203
|
+
# Open http://127.0.0.1:8080/
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Storybook provides:
|
|
207
|
+
- 📖 Interactive component documentation
|
|
208
|
+
- 🎨 Visual testing playground
|
|
209
|
+
- ♿ Accessibility testing tools
|
|
210
|
+
- 📱 Responsive design testing
|
|
211
|
+
- 🎯 Component isolation
|
|
212
|
+
|
|
213
|
+
## 🚀 Usage in Projects
|
|
214
|
+
|
|
215
|
+
<details>
|
|
216
|
+
<summary>Next.js Integration</summary>
|
|
217
|
+
|
|
218
|
+
1. Install the package and peer dependencies that are not currently in your project
|
|
219
|
+
``` bash
|
|
220
|
+
npm install @epam/ai-dial-ui-kit
|
|
221
|
+
npm install react react-dom @tabler/icons-react classnames
|
|
222
|
+
npm install @floating-ui/react monaco-editor @monaco-editor/react
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
2. Import style in the root layout of the project:
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
// app/layout.tsx
|
|
229
|
+
import "@epam/ai-dial-ui-kit/styles.css";
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
3. Usage example
|
|
233
|
+
|
|
234
|
+
```tsx
|
|
235
|
+
// app/page.tsx
|
|
236
|
+
"use client";
|
|
237
|
+
import { DialButton } from "@epam/ai-dial-ui-kit";
|
|
238
|
+
|
|
239
|
+
export default function Home() {
|
|
240
|
+
return (
|
|
241
|
+
<div className="w-full h-full flex flex-col gap-3 items-center justify-center">
|
|
242
|
+
<h1>Test library</h1>
|
|
243
|
+
<DialButton
|
|
244
|
+
onClick={() => console.log("Next.js + AI DIAL UI Kit!")}
|
|
245
|
+
title="Click me"
|
|
246
|
+
cssClass="dial-primary-button"
|
|
247
|
+
/>
|
|
248
|
+
</div>
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
</details>
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
### Tree Shaking
|
|
255
|
+
|
|
256
|
+
Import only the components you need:
|
|
257
|
+
|
|
258
|
+
```tsx
|
|
259
|
+
// ✅ Good - Tree shakable imports
|
|
260
|
+
import { DialButton, DialInput } from '@epam/ai-dial-ui-kit';
|
|
261
|
+
import '@epam/ai-dial-ui-kit/styles.css'; // Import styles separately
|
|
262
|
+
|
|
263
|
+
// ❌ Avoid - Imports entire library
|
|
264
|
+
import * as UIKit from '@epam/ai-dial-ui-kit';
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## 🤝 Contributing
|
|
268
|
+
|
|
269
|
+
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details on:
|
|
270
|
+
|
|
271
|
+
- Code style guidelines
|
|
272
|
+
- Testing requirements
|
|
273
|
+
- Pull request process
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
## 🔒 Security
|
|
277
|
+
|
|
278
|
+
If you discover a security vulnerability, please refer to our [Security Policy](./SECURITY.md).
|
|
279
|
+
|
|
280
|
+
## 📄 License
|
|
281
|
+
|
|
282
|
+
[Apache 2.0](./LICENSE) - see the [LICENSE](./LICENSE) file for details.
|
|
283
|
+
|
|
284
|
+
## 🌟 Related Projects
|
|
285
|
+
|
|
286
|
+
- [AI-DIAL](https://github.com/epam/ai-dial) - Entrypoint for all AI Dial projects
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
<p align="center">
|
|
291
|
+
Made with ❤️ by <a href="https://www.epam.com">EPAM Systems</a>
|
|
292
|
+
</p>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),E=require("classnames"),g=require("@floating-ui/react");require("monaco-editor");const pe=require("@monaco-editor/react");var D={exports:{}},S={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var K;function be(){if(K)return S;K=1;var r=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(l,n,i){var c=null;if(i!==void 0&&(c=""+i),n.key!==void 0&&(c=""+n.key),"key"in n){i={};for(var d in n)d!=="key"&&(i[d]=n[d])}else i=n;return n=i.ref,{$$typeof:r,type:l,key:c,ref:n!==void 0?n:null,props:i}}return S.Fragment=t,S.jsx=s,S.jsxs=s,S}var F={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ee;function ge(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case _:return"Profiler";case A:return"StrictMode";case le:return"Suspense";case ie:return"SuspenseList";case ue:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case C:return"Portal";case I:return(e.displayName||"Context")+".Provider";case N:return(e._context.displayName||"Context")+".Consumer";case se:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return a=e.displayName||null,a!==null?a:r(e.type)||"Memo";case J:a=e._payload,e=e._init;try{return r(e(a))}catch{}}return null}function t(e){return""+e}function s(e){try{t(e);var a=!1}catch{a=!0}if(a){a=console;var u=a.error,p=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",p),t(e)}}function l(e){if(e===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===J)return"<...>";try{var a=r(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function n(){var e=L.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function c(e){if(G.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function d(e,a){function u(){V||(V=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}function f(){var e=r(this.type);return H[e]||(H[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function x(e,a,u,p,T,j,M,$){return u=j.ref,e={$$typeof:w,type:e,key:a,props:j,_owner:T},(u!==void 0?u:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:f}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function m(e,a,u,p,T,j,M,$){var b=a.children;if(b!==void 0)if(p)if(fe(b)){for(p=0;p<b.length;p++)v(b[p]);Object.freeze&&Object.freeze(b)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(b);if(G.call(a,"key")){b=r(e);var y=Object.keys(a).filter(function(me){return me!=="key"});p=0<y.length?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}",Q[b+p]||(y=0<y.length?"{"+y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,p,b,y,b),Q[b+p]=!0)}if(b=null,u!==void 0&&(s(u),b=""+u),c(a)&&(s(a.key),b=""+a.key),"key"in a){u={};for(var q in a)q!=="key"&&(u[q]=a[q])}else u=a;return b&&d(u,typeof e=="function"?e.displayName||e.name||"Unknown":e),x(e,b,j,T,n(),u,M,$)}function v(e){typeof e=="object"&&e!==null&&e.$$typeof===w&&e._store&&(e._store.validated=1)}var R=h,w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),I=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),de=Symbol.for("react.client.reference"),L=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,fe=Array.isArray,Y=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var V,H={},X=R.react_stack_bottom_frame.bind(R,i)(),Z=Y(l(i)),Q={};F.Fragment=k,F.jsx=function(e,a,u,p,T){var j=1e4>L.recentlyCreatedOwnerStacks++;return m(e,a,u,!1,p,T,j?Error("react-stack-top-frame"):X,j?Y(l(e)):Z)},F.jsxs=function(e,a,u,p,T){var j=1e4>L.recentlyCreatedOwnerStacks++;return m(e,a,u,!0,p,T,j?Error("react-stack-top-frame"):X,j?Y(l(e)):Z)}})()),F}var re;function xe(){return re||(re=1,process.env.NODE_ENV==="production"?D.exports=be():D.exports=ge()),D.exports}var o=xe();const O=({icon:r,className:t})=>r?o.jsx("span",{className:E("flex-shrink-0",t),children:r}):null,ve=({title:r,cssClass:t,ref:s,onClick:l,disable:n,iconAfter:i,iconBefore:c,hideTitleOnMobile:d,ariaLabel:f})=>{const x=E("dial-small-semi",i?"mr-2":"",c?"ml-2":"",d?"hidden sm:inline":"inline"),m=E(t,"focus-visible:outline outline-offset-0");return o.jsxs("button",{ref:s,type:"button",className:m,onClick:v=>l?.(v),disabled:n,"aria-label":r||f,children:[o.jsx(O,{icon:c}),r&&o.jsx("span",{className:x,children:r}),o.jsx(O,{icon:i})]})},U=({errorText:r})=>r&&o.jsx("span",{className:"text-error dial-tiny mt-1",children:r}),z=({fieldTitle:r,htmlFor:t,optional:s,optionalText:l,cssClass:n})=>r?o.jsxs("label",{className:E("dial-tiny text-secondary",n,!n?.includes("mb")&&"mb-2"),htmlFor:t,children:[o.jsx("span",{className:"min-h-4",children:r}),s&&o.jsx("span",{className:"ml-1",children:l??"(Optional)"})]}):null,te=({value:r,textareaId:t,placeholder:s,cssClass:l="",disabled:n,invalid:i,readonly:c,onChange:d})=>o.jsx("textarea",{id:t,placeholder:s,value:r,disabled:n,className:E("dial-textarea dial-input",i?"dial-input-error":"",n&&"dial-input-disable",c&&"dial-input-readonly",l),onChange:f=>!c&&d?.(f.currentTarget.value)}),je=7,he=2,ne=h.createContext(null),oe=()=>{const r=h.useContext(ne);if(r==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return r},Ee=({initialOpen:r=!1,placement:t="bottom",isTriggerClickable:s=!1,open:l,onOpenChange:n}={})=>{const[i,c]=h.useState(r),d=h.useRef(null),f=l??i,x=n??c,m=g.useFloating({placement:t,open:f,onOpenChange:x,whileElementsMounted:g.autoUpdate,middleware:[g.offset(je+he),g.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),g.shift({padding:5}),g.arrow({element:d})]}),v=g.useHover(m.context,{move:!1,enabled:l==null,mouseOnly:s,delay:{open:500,close:0}}),R=g.useFocus(m.context,{enabled:l==null}),w=g.useDismiss(m.context),C=g.useRole(m.context,{role:"tooltip"}),k=g.useInteractions([v,R,w,C]);return h.useMemo(()=>({open:f,setOpen:x,arrowRef:d,...k,...m}),[f,x,k,m])},ke=({children:r,...t})=>{const s=Ee(t);return o.jsx(ne.Provider,{value:s,children:r})},Re=h.forwardRef(function({style:t,...s},l){const n=oe(),i=g.useMergeRefs([n.refs.setFloating,l]);return n.open?o.jsx(g.FloatingPortal,{id:"tooltip-portal",children:o.jsxs("div",{ref:i,style:{...n.floatingStyles,...t},...n.getFloatingProps(s),className:E("z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",n.getFloatingProps(s).className),children:[s.children,o.jsx(g.FloatingArrow,{ref:n.arrowRef,context:n.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),Te=h.forwardRef(function({children:t,asChild:s=!1,...l},n){const i=oe(),d=t&&typeof t=="object"&&"ref"in t&&t.ref!==void 0?t.ref:void 0,f=g.useMergeRefs([i.refs.setReference,n,d]);return s&&h.isValidElement(t)?h.cloneElement(t,i.getReferenceProps({ref:f,...l,...t.props})):o.jsx("span",{ref:f,...i.getReferenceProps(l),className:l.className??"dial-tooltip-trigger text-left",children:t})}),B=({hideTooltip:r,tooltip:t,children:s,triggerClassName:l,contentClassName:n,...i})=>r||!t?o.jsx("span",{className:l,children:s}):o.jsxs(ke,{...i,children:[o.jsx(Te,{className:l,children:s}),o.jsx(Re,{className:E("text-primary",n),children:t})]}),P=({iconBeforeInput:r,iconAfterInput:t,hideBorder:s,value:l,elementId:n,placeholder:i="",cssClass:c="",containerCssClass:d,type:f="text",disabled:x,readonly:m,invalid:v,onChange:R,min:w,max:C,prefix:k,suffix:A,textBeforeInput:_,textAfterInput:N})=>o.jsxs("div",{className:E("dial-input-field flex flex-row items-center justify-between",s?"dial-input-no-border":"dial-input",v&&"dial-input-error",x&&"dial-input-disable",m&&"dial-input-readonly",!_&&"pl-1",!N&&"pr-1",d),children:[_&&o.jsx(B,{tooltip:_,children:o.jsx(P,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"px-2 overflow-hidden overflow-ellipsis dial-small",value:_,disabled:!0,elementId:_+"textBefore"})}),k&&o.jsxs("p",{className:"text-secondary dial-small pl-2",children:[" ",k]}),o.jsx(O,{icon:r,className:"pl-2"}),o.jsx("input",{type:f,autoComplete:"new-password",id:n,placeholder:i,value:l??"",title:l?String(l):"",disabled:x,min:w,max:C,className:E("border-0 bg-transparent px-2",c),onChange:I=>!m&&R?.(I.currentTarget.value)}),o.jsx(O,{icon:t,className:"pr-2"}),A&&o.jsxs("p",{className:"text-secondary dial-small pr-2",children:[" ",A]}),N&&o.jsx(B,{tooltip:N,children:o.jsx(P,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",cssClass:"px-2",value:N,disabled:!0,elementId:N+"textAfter"})})]}),_e=/^0+\.(\d+)?$/,Ne=/^0+/,ae=({fieldTitle:r,errorText:t,optional:s,elementCssClass:l,elementContainerCssClass:n,elementId:i,containerCssClass:c,readonly:d,defaultEmptyText:f,min:x,max:m,...v})=>o.jsxs("div",{className:E("flex flex-col",c),children:[o.jsx(z,{fieldTitle:r,optional:s,htmlFor:i}),d?o.jsx("span",{children:v.value||(f??"None")}):o.jsxs(o.Fragment,{children:[o.jsx(P,{elementId:i,cssClass:l,containerCssClass:n,invalid:t!=null,min:x,max:m,...v}),o.jsx(U,{errorText:t})]})]}),we=({onChange:r,value:t,min:s,max:l,...n})=>{const i=c=>String(c)?.match(_e)?String(c)?.replace(Ne,"0"):Number(c);return o.jsx(ae,{type:"number",onChange:c=>r?.(i(c)),value:t,min:s,max:l,...n})},ye=({onChange:r,...t})=>o.jsx(ae,{type:"text",onChange:s=>r?.(s),...t}),Ce=({fieldTitle:r,optional:t,elementId:s,elementCssClass:l,errorText:n,...i})=>o.jsxs("div",{className:"flex flex-col",children:[o.jsx(z,{fieldTitle:r,optional:t,htmlFor:s}),o.jsx(te,{textareaId:s,cssClass:l,...i}),o.jsx(U,{errorText:n})]});var W=(r=>(r.dark="dark",r.light="light",r))(W||{});const Se={[W.dark]:{base:"vs-dark",inherit:!1,rules:[{token:"string.key.json",foreground:"#37BABC"},{token:"string.value.json",foreground:"#5C8DEA"},{token:"number",foreground:"#D97C27"},{token:"keyword.json",foreground:"#F4CE46"},{token:"delimiter",foreground:"#F3F4F6"},{token:"delimiter.bracket.json",foreground:"#A972FF"},{token:"delimiter.parenthesis",foreground:"#A972FF"}],colors:{"editor.foreground":"#F76464","editor.background":"#141A23","editorCursor.foreground":"#F3F4F6","editor.selectionBackground":"#5C8DEA2B","editorLineNumber.foreground":"#333942","scrollbarSlider.background":"#333942","scrollbarSlider.hoverBackground":"#333942","scrollbarSlider.activeBackground":"#333942"}},[W.light]:{base:"vs",inherit:!1,rules:[{token:"string.key.json",foreground:"#009D9F"},{token:"string.value.json",foreground:"#2764D9"},{token:"number",foreground:"#B25500"},{token:"keyword.json",foreground:"#3F3D25"},{token:"delimiter",foreground:"#141A23"},{token:"delimiter.bracket.json",foreground:"#843EF3"},{token:"delimiter.parenthesis",foreground:"#843EF3"}],colors:{"editor.foreground":"#AE2F2F","editor.background":"#F3F4F6","editorCursor.foreground":"#141A23","editor.selectionBackground":"#5C8DEA2B","editorLineNumber.foreground":"#333942","scrollbarSlider.background":"#333942","scrollbarSlider.hoverBackground":"#333942","scrollbarSlider.activeBackground":"#333942"}}},Fe=({value:r,onChange:t,onValidateJSON:s,options:l,currentTheme:n,themesConfig:i=Se})=>{function c(d){d?.editor?.defineTheme(n,i[n]),d.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:[{uri:"http://custom-schema/object-required.json",fileMatch:["*"],schema:{type:"object",description:"Top-level value must be an object",additionalProperties:!0}}]})}return o.jsx(pe.Editor,{beforeMount:c,height:"100%",defaultLanguage:"json",value:r,onChange:t,theme:n,onValidate:s,options:{minimap:{enabled:!1},formatOnType:!0,formatOnPaste:!0,selectOnLineNumbers:!1,automaticLayout:!0,scrollBeyondLastLine:!1,wordWrap:"on",smoothScrolling:!0,overviewRulerLanes:0,scrollbar:{horizontal:"hidden",verticalScrollbarSize:4,verticalSliderSize:4},...l??{}}})};exports.DialButton=ve;exports.DialErrorText=U;exports.DialFieldLabel=z;exports.DialIcon=O;exports.DialInput=P;exports.DialJsonEditor=Fe;exports.DialNumberInputField=we;exports.DialTextAreaField=Ce;exports.DialTextInputField=ye;exports.DialTextarea=te;exports.DialTooltip=B;
|