@altimateai/ui-components 0.0.27 → 0.0.29
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/CoachForm.js +3977 -3959
- package/dist/Form.js +804 -744
- package/dist/assets/icons/index.d.ts +2 -0
- package/dist/assets/icons/index.js +17 -16
- package/dist/chatbotV2/index.d.ts +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index2.js +18 -17
- package/dist/shadcn/index.d.ts +20 -2
- package/dist/shadcn/index.js +812 -809
- package/dist/storybook/AutosizeTextarea.stories.tsx +52 -0
- package/dist/{types-CPlzEfL7.d.ts → types-Dr98SsnM.d.ts} +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
2
|
+
import { AutosizeTextarea } from "./AutosizeTextarea";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Shadcn/Components/AutosizeTextarea",
|
|
7
|
+
component: AutosizeTextarea,
|
|
8
|
+
argTypes: {
|
|
9
|
+
disabled: {
|
|
10
|
+
control: "boolean",
|
|
11
|
+
},
|
|
12
|
+
placeholder: {
|
|
13
|
+
control: "text",
|
|
14
|
+
},
|
|
15
|
+
minHeight: {
|
|
16
|
+
control: "number",
|
|
17
|
+
},
|
|
18
|
+
maxHeight: {
|
|
19
|
+
control: "number",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} as Meta;
|
|
23
|
+
|
|
24
|
+
const Template: StoryFn = args => {
|
|
25
|
+
const [value, setValue] = useState(args.value || "");
|
|
26
|
+
|
|
27
|
+
return <AutosizeTextarea {...args} value={value} onChange={e => setValue(e.target.value)} />;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = {
|
|
32
|
+
placeholder: "Type your message here. The textarea will grow as you type.",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const WithMinHeight = Template.bind({});
|
|
36
|
+
WithMinHeight.args = {
|
|
37
|
+
placeholder: "This textarea has a custom minimum height",
|
|
38
|
+
minHeight: 100,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const WithMaxHeight = Template.bind({});
|
|
42
|
+
WithMaxHeight.args = {
|
|
43
|
+
placeholder: "This textarea will stop growing at 200px height",
|
|
44
|
+
maxHeight: 200,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const WithMinAndMaxHeight = Template.bind({});
|
|
48
|
+
WithMinAndMaxHeight.args = {
|
|
49
|
+
placeholder: "Min height: 80px, Max height: 150px",
|
|
50
|
+
minHeight: 80,
|
|
51
|
+
maxHeight: 150,
|
|
52
|
+
};
|
|
@@ -68,6 +68,7 @@ interface ChatbotProviderProps extends ChatbotProps {
|
|
|
68
68
|
requestParams?: RequestInit;
|
|
69
69
|
components?: {
|
|
70
70
|
feedback?: ReactNode;
|
|
71
|
+
questionFormButtons?: (userPrompt: string, onAccept: (improvedPrompt: string) => void) => ReactNode;
|
|
71
72
|
};
|
|
72
73
|
contextOptions?: ContextOption[];
|
|
73
74
|
isMarkdownResponse?: boolean;
|
|
@@ -144,6 +145,7 @@ interface ChatState {
|
|
|
144
145
|
}[];
|
|
145
146
|
components?: {
|
|
146
147
|
feedback?: ReactNode;
|
|
148
|
+
questionFormButtons?: (userPrompt: string, onAccept: (improvedPrompt: string) => void) => ReactNode;
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
interface TodoItem {
|