@app-studio/web 0.9.39 → 0.9.43
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/dist/bot/Bot.d.ts +15 -0
- package/dist/bot/Cache.d.ts +13 -0
- package/dist/bot/Config.d.ts +13 -0
- package/dist/bot/ContentFetcher.d.ts +9 -0
- package/dist/bot/DocuCode.d.ts +19 -0
- package/dist/bot/FileHandler.d.ts +39 -0
- package/dist/bot/ai/AnthropicConnector.d.ts +6 -0
- package/dist/bot/ai/GeminiConnector.d.ts +7 -0
- package/dist/bot/ai/GroqConnector.d.ts +7 -0
- package/dist/bot/ai/HuggingFaceConnector.d.ts +6 -0
- package/dist/bot/ai/OpenAIConnector.d.ts +11 -0
- package/dist/bot/ai/ReplicateConnector.d.ts +7 -0
- package/dist/bot/ai/SambaNovaConnector.d.ts +6 -0
- package/dist/bot/ai/ai.config.d.ts +12 -0
- package/dist/bot/ai/ai.service.d.ts +36 -0
- package/dist/bot/data.d.ts +19 -0
- package/dist/bot/extractors.d.ts +8 -0
- package/dist/bot/index.d.ts +1 -0
- package/dist/bot/prompt/1-project.d.ts +1 -0
- package/dist/bot/prompt/2-response.d.ts +1 -0
- package/dist/bot/prompt/3-comment.d.ts +1 -0
- package/docs/components/Accordion.mdx +74 -121
- package/docs/components/Alert.mdx +18 -69
- package/docs/components/AspectRatio.mdx +11 -9
- package/docs/components/AudioInput.mdx +43 -0
- package/docs/components/Avatar.mdx +17 -42
- package/docs/components/Background.mdx +99 -491
- package/docs/components/Badge.mdx +37 -122
- package/docs/components/Button.mdx +71 -123
- package/docs/components/Calendar.mdx +7 -7
- package/docs/components/Card.mdx +238 -281
- package/docs/components/Carousel.mdx +88 -315
- package/docs/components/Center.mdx +22 -22
- package/docs/components/Chart.mdx +171 -26
- package/docs/components/ChatInput.mdx +327 -275
- package/docs/components/Checkbox.mdx +3 -5
- package/docs/components/ColorInput.mdx +10 -10
- package/docs/components/ColorPicker.mdx +452 -0
- package/docs/components/ComboBox.mdx +14 -14
- package/docs/components/Command.mdx +140 -188
- package/docs/components/ContextMenu.mdx +47 -171
- package/docs/components/CookieConsent.mdx +53 -0
- package/docs/components/CountryPicker.mdx +10 -10
- package/docs/components/DatePicker.mdx +4 -4
- package/docs/components/DragAndDrop.mdx +279 -463
- package/docs/components/Drawer.mdx +401 -100
- package/docs/components/DropdownMenu.mdx +37 -155
- package/docs/components/EmojiPicker.mdx +84 -0
- package/docs/components/File.mdx +130 -4
- package/docs/components/Flow.mdx +3 -3
- package/docs/components/Form.mdx +4 -4
- package/docs/components/Formik.mdx +41 -41
- package/docs/components/Gradient.mdx +355 -178
- package/docs/components/Horizontal.mdx +1 -2
- package/docs/components/HoverCard.mdx +57 -125
- package/docs/components/Icon.mdx +10 -10
- package/docs/components/KanbanBoard.mdx +12 -12
- package/docs/components/Label.mdx +8 -8
- package/docs/components/Link.mdx +19 -27
- package/docs/components/Loader.mdx +224 -407
- package/docs/components/Menubar.mdx +71 -67
- package/docs/components/Message.mdx +211 -526
- package/docs/components/Modal.mdx +351 -475
- package/docs/components/NavigationMenu.mdx +8 -8
- package/docs/components/OTPInput.mdx +194 -0
- package/docs/components/Pagination.mdx +451 -107
- package/docs/components/Password.mdx +8 -8
- package/docs/components/ProgressBar.mdx +460 -0
- package/docs/components/Resizable.mdx +103 -102
- package/docs/components/Select.mdx +5 -5
- package/docs/components/Separator.mdx +11 -98
- package/docs/components/ShareButton.mdx +29 -0
- package/docs/components/Sidebar.mdx +70 -131
- package/docs/components/Slider.mdx +99 -185
- package/docs/components/StatusIndicator.mdx +373 -0
- package/docs/components/Switch.mdx +3 -3
- package/docs/components/Table.mdx +25 -105
- package/docs/components/Tabs.mdx +40 -143
- package/docs/components/TagInput.mdx +32 -32
- package/docs/components/Text.mdx +3 -3
- package/docs/components/TextArea.mdx +9 -9
- package/docs/components/TextField.mdx +17 -17
- package/docs/components/Title.mdx +267 -525
- package/docs/components/Toast.mdx +65 -142
- package/docs/components/Toggle.mdx +34 -46
- package/docs/components/ToggleGroup.mdx +29 -50
- package/docs/components/Tooltip.mdx +500 -137
- package/docs/components/Tree.mdx +4 -4
- package/docs/components/Uploader.mdx +205 -351
- package/docs/components/Vertical.mdx +22 -22
- package/package.json +1 -1
- package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
- package/dist/components/AuthGuard/index.d.ts +0 -1
- package/docs/adk-components.md +0 -319
- package/docs/adk-quick-start.md +0 -268
|
@@ -11,7 +11,7 @@ A customizable checkbox form element with optional label and various views.
|
|
|
11
11
|
```tsx
|
|
12
12
|
import React from 'react';
|
|
13
13
|
|
|
14
|
-
import { Checkbox } from '
|
|
14
|
+
import { Checkbox } from '@app-studio/web';
|
|
15
15
|
|
|
16
16
|
export const DefaultCheckbox = () => <Checkbox label="option" />;
|
|
17
17
|
|
|
@@ -22,9 +22,7 @@ Optional color scheme string that might allow customization of the checkbox's ap
|
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
24
|
import React from 'react';
|
|
25
|
-
import { Vertical } from 'app-studio';
|
|
26
|
-
|
|
27
|
-
import { Checkbox } from '../Checkbox';
|
|
25
|
+
import { Vertical, Checkbox } from '@app-studio/web';
|
|
28
26
|
|
|
29
27
|
export const ColorCheckbox = () => (
|
|
30
28
|
<Vertical gap={15}>
|
|
@@ -52,7 +50,7 @@ An optional shadow or elevation effect that can be applied to the Checkbox compo
|
|
|
52
50
|
|
|
53
51
|
```tsx
|
|
54
52
|
import React from 'react';
|
|
55
|
-
import { Checkbox } from '
|
|
53
|
+
import { Checkbox } from '@app-studio/web';
|
|
56
54
|
|
|
57
55
|
export const ShadowCheckbox = () => (
|
|
58
56
|
<Checkbox
|
|
@@ -12,7 +12,7 @@ A simple color input with default settings.
|
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
14
|
import React, { useState } from 'react';
|
|
15
|
-
import { ColorInput } from '
|
|
15
|
+
import { ColorInput } from '@app-studio/web';
|
|
16
16
|
|
|
17
17
|
export const BasicColorInput = () => {
|
|
18
18
|
const [color, setColor] = useState('color.blue.500');
|
|
@@ -34,8 +34,8 @@ Different visual styles for the color input.
|
|
|
34
34
|
|
|
35
35
|
```tsx
|
|
36
36
|
import React from 'react';
|
|
37
|
-
import { Vertical } from 'app-studio';
|
|
38
|
-
import { ColorInput } from '
|
|
37
|
+
import { Vertical } from '@app-studio/web';
|
|
38
|
+
import { ColorInput } from '@app-studio/web';
|
|
39
39
|
|
|
40
40
|
export const ColorInputVariants = () => {
|
|
41
41
|
return (
|
|
@@ -67,8 +67,8 @@ Different sizes for the color input.
|
|
|
67
67
|
|
|
68
68
|
```tsx
|
|
69
69
|
import React from 'react';
|
|
70
|
-
import { Vertical } from 'app-studio';
|
|
71
|
-
import { ColorInput } from '
|
|
70
|
+
import { Vertical } from '@app-studio/web';
|
|
71
|
+
import { ColorInput } from '@app-studio/web';
|
|
72
72
|
|
|
73
73
|
export const ColorInputSizes = () => {
|
|
74
74
|
return (
|
|
@@ -88,7 +88,7 @@ Color input with custom color palette and options.
|
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
90
90
|
import React, { useState } from 'react';
|
|
91
|
-
import { ColorInput } from '
|
|
91
|
+
import { ColorInput } from '@app-studio/web';
|
|
92
92
|
|
|
93
93
|
export const CustomColorInput = () => {
|
|
94
94
|
const [color, setColor] = useState('');
|
|
@@ -119,10 +119,10 @@ Color input integrated with form handling.
|
|
|
119
119
|
|
|
120
120
|
```tsx
|
|
121
121
|
import React, { useState } from 'react';
|
|
122
|
-
import { Vertical, Horizontal } from 'app-studio';
|
|
123
|
-
import { ColorInput } from '
|
|
124
|
-
import { Button } from '
|
|
125
|
-
import { Text } from 'app-studio';
|
|
122
|
+
import { Vertical, Horizontal } from '@app-studio/web';
|
|
123
|
+
import { ColorInput } from '@app-studio/web';
|
|
124
|
+
import { Button } from '@app-studio/web';
|
|
125
|
+
import { Text } from '@app-studio/web';
|
|
126
126
|
|
|
127
127
|
export const ColorInputForm = () => {
|
|
128
128
|
const [backgroundColor, setBackgroundColor] = useState('color.blue.500');
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
# ColorPicker
|
|
2
|
+
|
|
3
|
+
A customizable color picker component with predefined colors, custom input, recent colors, and various color formats.
|
|
4
|
+
|
|
5
|
+
### **Import**
|
|
6
|
+
```tsx
|
|
7
|
+
import { ColorPicker } from '@app-studio/web';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### **Default**
|
|
11
|
+
```tsx
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { ColorPicker } from '@app-studio/web';
|
|
14
|
+
|
|
15
|
+
export const DefaultColorPicker = () => (
|
|
16
|
+
<ColorPicker
|
|
17
|
+
onChange={(color) => console.log('Selected color:', color)}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### **value & onChange**
|
|
23
|
+
Controlled color value.
|
|
24
|
+
|
|
25
|
+
- **Type:** `string` & `(color: string) => void`
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import React, { useState } from 'react';
|
|
29
|
+
import { ColorPicker } from '@app-studio/web';
|
|
30
|
+
import { Text, Vertical } from 'app-studio';
|
|
31
|
+
|
|
32
|
+
export const ControlledColorPicker = () => {
|
|
33
|
+
const [color, setColor] = useState('#3b82f6');
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Vertical gap={10}>
|
|
37
|
+
<ColorPicker value={color} onChange={setColor} />
|
|
38
|
+
<Text>Selected: {color}</Text>
|
|
39
|
+
</Vertical>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### **defaultValue**
|
|
45
|
+
Default color value.
|
|
46
|
+
|
|
47
|
+
- **Type:** `string`
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import React from 'react';
|
|
51
|
+
import { ColorPicker } from '@app-studio/web';
|
|
52
|
+
|
|
53
|
+
export const DefaultValueColorPicker = () => (
|
|
54
|
+
<ColorPicker
|
|
55
|
+
defaultValue="#10b981"
|
|
56
|
+
onChange={(color) => console.log(color)}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### **predefinedColors**
|
|
62
|
+
Array of predefined colors to display.
|
|
63
|
+
|
|
64
|
+
- **Type:** `PredefinedColor[]`
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import React from 'react';
|
|
68
|
+
import { ColorPicker } from '@app-studio/web';
|
|
69
|
+
|
|
70
|
+
export const PredefinedColorPicker = () => {
|
|
71
|
+
const colors = [
|
|
72
|
+
{ color: '#ef4444', label: 'Red' },
|
|
73
|
+
{ color: '#3b82f6', label: 'Blue' },
|
|
74
|
+
{ color: '#10b981', label: 'Green' },
|
|
75
|
+
{ color: '#f59e0b', label: 'Orange' },
|
|
76
|
+
{ color: '#8b5cf6', label: 'Purple' },
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<ColorPicker
|
|
81
|
+
predefinedColors={colors}
|
|
82
|
+
onChange={(color) => console.log(color)}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### **showCustomInput**
|
|
89
|
+
Whether to show the custom color input field.
|
|
90
|
+
|
|
91
|
+
- **Type:** `boolean`
|
|
92
|
+
- **Default:** `true`
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import React from 'react';
|
|
96
|
+
import { ColorPicker } from '@app-studio/web';
|
|
97
|
+
|
|
98
|
+
export const NoCustomInputColorPicker = () => (
|
|
99
|
+
<ColorPicker
|
|
100
|
+
showCustomInput={false}
|
|
101
|
+
onChange={(color) => console.log(color)}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### **showRecentColors**
|
|
107
|
+
Whether to show recently selected colors.
|
|
108
|
+
|
|
109
|
+
- **Type:** `boolean`
|
|
110
|
+
- **Default:** `true`
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import React from 'react';
|
|
114
|
+
import { ColorPicker } from '@app-studio/web';
|
|
115
|
+
|
|
116
|
+
export const NoRecentColorsColorPicker = () => (
|
|
117
|
+
<ColorPicker
|
|
118
|
+
showRecentColors={false}
|
|
119
|
+
onChange={(color) => console.log(color)}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### **maxRecentColors**
|
|
125
|
+
Maximum number of recent colors to store.
|
|
126
|
+
|
|
127
|
+
- **Type:** `number`
|
|
128
|
+
- **Default:** `6`
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import React from 'react';
|
|
132
|
+
import { ColorPicker } from '@app-studio/web';
|
|
133
|
+
|
|
134
|
+
export const MaxRecentColorPicker = () => (
|
|
135
|
+
<ColorPicker
|
|
136
|
+
maxRecentColors={10}
|
|
137
|
+
onChange={(color) => console.log(color)}
|
|
138
|
+
/>
|
|
139
|
+
);
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### **colorFormat**
|
|
143
|
+
Format for the color value.
|
|
144
|
+
|
|
145
|
+
- **Type:** `ColorFormat`
|
|
146
|
+
- **Default:** `'hex'`
|
|
147
|
+
- **Possible Values:** `'hex' | 'rgb' | 'hsl'`
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
import React from 'react';
|
|
151
|
+
import { ColorPicker } from '@app-studio/web';
|
|
152
|
+
import { Vertical } from 'app-studio';
|
|
153
|
+
|
|
154
|
+
export const ColorFormatPickers = () => (
|
|
155
|
+
<Vertical gap={15}>
|
|
156
|
+
<ColorPicker
|
|
157
|
+
colorFormat="hex"
|
|
158
|
+
onChange={(color) => console.log('HEX:', color)}
|
|
159
|
+
/>
|
|
160
|
+
<ColorPicker
|
|
161
|
+
colorFormat="rgb"
|
|
162
|
+
onChange={(color) => console.log('RGB:', color)}
|
|
163
|
+
/>
|
|
164
|
+
<ColorPicker
|
|
165
|
+
colorFormat="hsl"
|
|
166
|
+
onChange={(color) => console.log('HSL:', color)}
|
|
167
|
+
/>
|
|
168
|
+
</Vertical>
|
|
169
|
+
);
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### **closeOnSelect**
|
|
173
|
+
Whether to close the dropdown after selecting a color.
|
|
174
|
+
|
|
175
|
+
- **Type:** `boolean`
|
|
176
|
+
- **Default:** `true`
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import React from 'react';
|
|
180
|
+
import { ColorPicker } from '@app-studio/web';
|
|
181
|
+
|
|
182
|
+
export const StayOpenColorPicker = () => (
|
|
183
|
+
<ColorPicker
|
|
184
|
+
closeOnSelect={false}
|
|
185
|
+
onChange={(color) => console.log(color)}
|
|
186
|
+
/>
|
|
187
|
+
);
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### **isDisabled**
|
|
191
|
+
Whether the color picker is disabled.
|
|
192
|
+
|
|
193
|
+
- **Type:** `boolean`
|
|
194
|
+
- **Default:** `false`
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
import React from 'react';
|
|
198
|
+
import { ColorPicker } from '@app-studio/web';
|
|
199
|
+
|
|
200
|
+
export const DisabledColorPicker = () => (
|
|
201
|
+
<ColorPicker
|
|
202
|
+
isDisabled
|
|
203
|
+
value="#3b82f6"
|
|
204
|
+
onChange={(color) => console.log(color)}
|
|
205
|
+
/>
|
|
206
|
+
);
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### **isReadOnly**
|
|
210
|
+
Whether the color picker is read-only.
|
|
211
|
+
|
|
212
|
+
- **Type:** `boolean`
|
|
213
|
+
- **Default:** `false`
|
|
214
|
+
|
|
215
|
+
```tsx
|
|
216
|
+
import React from 'react';
|
|
217
|
+
import { ColorPicker } from '@app-studio/web';
|
|
218
|
+
|
|
219
|
+
export const ReadOnlyColorPicker = () => (
|
|
220
|
+
<ColorPicker
|
|
221
|
+
isReadOnly
|
|
222
|
+
value="#3b82f6"
|
|
223
|
+
onChange={(color) => console.log(color)}
|
|
224
|
+
/>
|
|
225
|
+
);
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### **size**
|
|
229
|
+
Size of the color picker.
|
|
230
|
+
|
|
231
|
+
- **Type:** `Size`
|
|
232
|
+
- **Default:** `'md'`
|
|
233
|
+
- **Possible Values:** `'xs' | 'sm' | 'md' | 'lg' | 'xl'`
|
|
234
|
+
|
|
235
|
+
```tsx
|
|
236
|
+
import React from 'react';
|
|
237
|
+
import { ColorPicker } from '@app-studio/web';
|
|
238
|
+
import { Horizontal } from 'app-studio';
|
|
239
|
+
|
|
240
|
+
export const SizedColorPickers = () => (
|
|
241
|
+
<Horizontal gap={15}>
|
|
242
|
+
{['sm', 'md', 'lg'].map((size) => (
|
|
243
|
+
<ColorPicker
|
|
244
|
+
key={size}
|
|
245
|
+
size={size as any}
|
|
246
|
+
onChange={(color) => console.log(color)}
|
|
247
|
+
/>
|
|
248
|
+
))}
|
|
249
|
+
</Horizontal>
|
|
250
|
+
);
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### **shape**
|
|
254
|
+
Shape of the color picker trigger.
|
|
255
|
+
|
|
256
|
+
- **Type:** `Shape`
|
|
257
|
+
- **Default:** `'rounded'`
|
|
258
|
+
- **Possible Values:** `'sharp' | 'rounded' | 'pillShaped'`
|
|
259
|
+
|
|
260
|
+
```tsx
|
|
261
|
+
import React from 'react';
|
|
262
|
+
import { ColorPicker } from '@app-studio/web';
|
|
263
|
+
import { Horizontal } from 'app-studio';
|
|
264
|
+
|
|
265
|
+
export const ShapedColorPickers = () => (
|
|
266
|
+
<Horizontal gap={15}>
|
|
267
|
+
{['sharp', 'rounded', 'pillShaped'].map((shape) => (
|
|
268
|
+
<ColorPicker
|
|
269
|
+
key={shape}
|
|
270
|
+
shape={shape as any}
|
|
271
|
+
onChange={(color) => console.log(color)}
|
|
272
|
+
/>
|
|
273
|
+
))}
|
|
274
|
+
</Horizontal>
|
|
275
|
+
);
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### **variant**
|
|
279
|
+
Visual style variant.
|
|
280
|
+
|
|
281
|
+
- **Type:** `Variant`
|
|
282
|
+
- **Possible Values:** `'default' | 'outlined' | 'filled'`
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
import React from 'react';
|
|
286
|
+
import { ColorPicker } from '@app-studio/web';
|
|
287
|
+
import { Horizontal } from 'app-studio';
|
|
288
|
+
|
|
289
|
+
export const VariantColorPickers = () => (
|
|
290
|
+
<Horizontal gap={15}>
|
|
291
|
+
{['default', 'outlined', 'filled'].map((variant) => (
|
|
292
|
+
<ColorPicker
|
|
293
|
+
key={variant}
|
|
294
|
+
variant={variant as any}
|
|
295
|
+
onChange={(color) => console.log(color)}
|
|
296
|
+
/>
|
|
297
|
+
))}
|
|
298
|
+
</Horizontal>
|
|
299
|
+
);
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### **label**
|
|
303
|
+
Label for the color picker.
|
|
304
|
+
|
|
305
|
+
- **Type:** `string`
|
|
306
|
+
|
|
307
|
+
```tsx
|
|
308
|
+
import React from 'react';
|
|
309
|
+
import { ColorPicker } from '@app-studio/web';
|
|
310
|
+
|
|
311
|
+
export const LabeledColorPicker = () => (
|
|
312
|
+
<ColorPicker
|
|
313
|
+
label="Choose a color"
|
|
314
|
+
onChange={(color) => console.log(color)}
|
|
315
|
+
/>
|
|
316
|
+
);
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### **helperText**
|
|
320
|
+
Helper text to display below the color picker.
|
|
321
|
+
|
|
322
|
+
- **Type:** `string`
|
|
323
|
+
|
|
324
|
+
```tsx
|
|
325
|
+
import React from 'react';
|
|
326
|
+
import { ColorPicker } from '@app-studio/web';
|
|
327
|
+
|
|
328
|
+
export const HelperTextColorPicker = () => (
|
|
329
|
+
<ColorPicker
|
|
330
|
+
label="Brand Color"
|
|
331
|
+
helperText="Select your primary brand color"
|
|
332
|
+
onChange={(color) => console.log(color)}
|
|
333
|
+
/>
|
|
334
|
+
);
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### **error**
|
|
338
|
+
Whether the color picker is in an error state.
|
|
339
|
+
|
|
340
|
+
- **Type:** `boolean`
|
|
341
|
+
- **Default:** `false`
|
|
342
|
+
|
|
343
|
+
```tsx
|
|
344
|
+
import React from 'react';
|
|
345
|
+
import { ColorPicker } from '@app-studio/web';
|
|
346
|
+
|
|
347
|
+
export const ErrorColorPicker = () => (
|
|
348
|
+
<ColorPicker
|
|
349
|
+
error
|
|
350
|
+
helperText="Please select a valid color"
|
|
351
|
+
onChange={(color) => console.log(color)}
|
|
352
|
+
/>
|
|
353
|
+
);
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### **onChangeComplete**
|
|
357
|
+
Callback when color selection is complete.
|
|
358
|
+
|
|
359
|
+
- **Type:** `(color: string) => void`
|
|
360
|
+
|
|
361
|
+
```tsx
|
|
362
|
+
import React from 'react';
|
|
363
|
+
import { ColorPicker } from '@app-studio/web';
|
|
364
|
+
|
|
365
|
+
export const CompleteCallbackColorPicker = () => (
|
|
366
|
+
<ColorPicker
|
|
367
|
+
onChange={(color) => console.log('Changing:', color)}
|
|
368
|
+
onChangeComplete={(color) => console.log('Complete:', color)}
|
|
369
|
+
/>
|
|
370
|
+
);
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### **views**
|
|
374
|
+
Custom styles for different parts of the color picker.
|
|
375
|
+
|
|
376
|
+
- **Type:** `ColorPickerStyles`
|
|
377
|
+
|
|
378
|
+
```tsx
|
|
379
|
+
import React from 'react';
|
|
380
|
+
import { ColorPicker } from '@app-studio/web';
|
|
381
|
+
|
|
382
|
+
export const StyledColorPicker = () => (
|
|
383
|
+
<ColorPicker
|
|
384
|
+
onChange={(color) => console.log(color)}
|
|
385
|
+
views={{
|
|
386
|
+
trigger: {
|
|
387
|
+
borderWidth: 2,
|
|
388
|
+
borderColor: '#3b82f6',
|
|
389
|
+
},
|
|
390
|
+
dropdown: {
|
|
391
|
+
backgroundColor: '#f9fafb',
|
|
392
|
+
padding: 20,
|
|
393
|
+
},
|
|
394
|
+
colorSwatch: {
|
|
395
|
+
borderRadius: 8,
|
|
396
|
+
}
|
|
397
|
+
}}
|
|
398
|
+
/>
|
|
399
|
+
);
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### **Complete Example**
|
|
403
|
+
A fully featured color picker with all options.
|
|
404
|
+
|
|
405
|
+
```tsx
|
|
406
|
+
import React, { useState } from 'react';
|
|
407
|
+
import { ColorPicker } from '@app-studio/web';
|
|
408
|
+
import { Vertical, Text } from 'app-studio';
|
|
409
|
+
|
|
410
|
+
export const CompleteColorPicker = () => {
|
|
411
|
+
const [color, setColor] = useState('#3b82f6');
|
|
412
|
+
|
|
413
|
+
const predefinedColors = [
|
|
414
|
+
{ color: '#ef4444', label: 'Red' },
|
|
415
|
+
{ color: '#3b82f6', label: 'Blue' },
|
|
416
|
+
{ color: '#10b981', label: 'Green' },
|
|
417
|
+
{ color: '#f59e0b', label: 'Orange' },
|
|
418
|
+
{ color: '#8b5cf6', label: 'Purple' },
|
|
419
|
+
{ color: '#ec4899', label: 'Pink' },
|
|
420
|
+
];
|
|
421
|
+
|
|
422
|
+
return (
|
|
423
|
+
<Vertical gap={15}>
|
|
424
|
+
<ColorPicker
|
|
425
|
+
label="Theme Color"
|
|
426
|
+
helperText="Choose your theme color"
|
|
427
|
+
value={color}
|
|
428
|
+
onChange={setColor}
|
|
429
|
+
onChangeComplete={(c) => console.log('Final color:', c)}
|
|
430
|
+
predefinedColors={predefinedColors}
|
|
431
|
+
showCustomInput
|
|
432
|
+
showRecentColors
|
|
433
|
+
maxRecentColors={8}
|
|
434
|
+
colorFormat="hex"
|
|
435
|
+
size="md"
|
|
436
|
+
shape="rounded"
|
|
437
|
+
variant="outlined"
|
|
438
|
+
/>
|
|
439
|
+
<Text>Selected Color: {color}</Text>
|
|
440
|
+
<div
|
|
441
|
+
style={{
|
|
442
|
+
width: 100,
|
|
443
|
+
height: 100,
|
|
444
|
+
backgroundColor: color,
|
|
445
|
+
borderRadius: 8
|
|
446
|
+
}}
|
|
447
|
+
/>
|
|
448
|
+
</Vertical>
|
|
449
|
+
);
|
|
450
|
+
};
|
|
451
|
+
```
|
|
452
|
+
|
|
@@ -10,7 +10,7 @@ A customizable dropdown list with optional search functionality.
|
|
|
10
10
|
### **Default**
|
|
11
11
|
```tsx
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import { ComboBox } from '
|
|
13
|
+
import { ComboBox } from '@app-studio/web';
|
|
14
14
|
|
|
15
15
|
export const DefaultDemo = () => {
|
|
16
16
|
const items = [
|
|
@@ -37,9 +37,9 @@ Optional callback function triggered when an item is selected.
|
|
|
37
37
|
|
|
38
38
|
```tsx
|
|
39
39
|
import React from 'react';
|
|
40
|
-
import { ComboBox } from '
|
|
41
|
-
import { Vertical } from 'app-studio';
|
|
42
|
-
import { MessageLayout, showMessage } from '
|
|
40
|
+
import { ComboBox } from '@app-studio/web';
|
|
41
|
+
import { Vertical } from '@app-studio/web';
|
|
42
|
+
import { MessageLayout, showMessage } from '@app-studio/web';
|
|
43
43
|
|
|
44
44
|
export const OnSelectDemo = () => {
|
|
45
45
|
const items = [
|
|
@@ -101,7 +101,7 @@ Flag to enable search functionality within the ComboBox.
|
|
|
101
101
|
|
|
102
102
|
```tsx
|
|
103
103
|
import React from 'react';
|
|
104
|
-
import { ComboBox } from '
|
|
104
|
+
import { ComboBox } from '@app-studio/web';
|
|
105
105
|
|
|
106
106
|
export const SearchEnabledDemo = () => {
|
|
107
107
|
const items = [
|
|
@@ -136,8 +136,8 @@ Optional element to display on the left side of the ComboBox.
|
|
|
136
136
|
|
|
137
137
|
```tsx
|
|
138
138
|
import React from 'react';
|
|
139
|
-
import { Badge } from '
|
|
140
|
-
import { ComboBox } from '
|
|
139
|
+
import { Badge } from '@app-studio/web';
|
|
140
|
+
import { ComboBox } from '@app-studio/web';
|
|
141
141
|
|
|
142
142
|
export const LeftDemo = () => {
|
|
143
143
|
const items = [
|
|
@@ -168,8 +168,8 @@ Optional element to display on the right side of the ComboBox.
|
|
|
168
168
|
|
|
169
169
|
```tsx
|
|
170
170
|
import React from 'react';
|
|
171
|
-
import { Badge } from '
|
|
172
|
-
import { ComboBox } from '
|
|
171
|
+
import { Badge } from '@app-studio/web';
|
|
172
|
+
import { ComboBox } from '@app-studio/web';
|
|
173
173
|
|
|
174
174
|
export const RightDemo = () => {
|
|
175
175
|
const items = [
|
|
@@ -196,7 +196,7 @@ Optional label to describe the purpose of the ComboBox.
|
|
|
196
196
|
```tsx
|
|
197
197
|
import React from 'react';
|
|
198
198
|
import PlusIcon from '../../../Icon/Plus';
|
|
199
|
-
import { ComboBox } from '
|
|
199
|
+
import { ComboBox } from '@app-studio/web';
|
|
200
200
|
|
|
201
201
|
export const LabelDemo = () => {
|
|
202
202
|
const items = [
|
|
@@ -227,7 +227,7 @@ Flag to show a tick mark next to selected items.
|
|
|
227
227
|
|
|
228
228
|
```tsx
|
|
229
229
|
import React from 'react';
|
|
230
|
-
import { ComboBox } from '
|
|
230
|
+
import { ComboBox } from '@app-studio/web';
|
|
231
231
|
|
|
232
232
|
export const ShowTickDemo = () => {
|
|
233
233
|
const statuses = [
|
|
@@ -262,7 +262,7 @@ Text to display when nothing has been selected in the ComboBox.
|
|
|
262
262
|
|
|
263
263
|
```tsx
|
|
264
264
|
import React from 'react';
|
|
265
|
-
import { ComboBox } from '
|
|
265
|
+
import { ComboBox } from '@app-studio/web';
|
|
266
266
|
|
|
267
267
|
export const PlaceholderDemo = () => {
|
|
268
268
|
const items = [
|
|
@@ -293,7 +293,7 @@ Optional custom styles to apply to the ComboBox.
|
|
|
293
293
|
|
|
294
294
|
```tsx
|
|
295
295
|
import React from 'react';
|
|
296
|
-
import { ComboBox } from '
|
|
296
|
+
import { ComboBox } from '@app-studio/web';
|
|
297
297
|
|
|
298
298
|
export const StylesDemo = () => {
|
|
299
299
|
const items = [
|
|
@@ -338,7 +338,7 @@ Placeholder text for the search input when search is enabled.
|
|
|
338
338
|
|
|
339
339
|
```tsx
|
|
340
340
|
import React from 'react';
|
|
341
|
-
import { ComboBox } from '
|
|
341
|
+
import { ComboBox } from '@app-studio/web';
|
|
342
342
|
|
|
343
343
|
export const SearchPlaceholderDemo = () => {
|
|
344
344
|
const items = [
|