@assistant-ui/react 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/tailwindcss/index.ts
31
+ var tailwindcss_exports = {};
32
+ __export(tailwindcss_exports, {
33
+ default: () => tailwindcss_default
34
+ });
35
+ module.exports = __toCommonJS(tailwindcss_exports);
36
+ var import_plugin = __toESM(require("tailwindcss/plugin"));
37
+ var auiPlugin = import_plugin.default.withOptions(
38
+ ({ components = ["assistant-modal", "thread"], shadcn = false } = {}) => ({ addComponents }) => {
39
+ const assistantModal = components.includes("assistant-modal");
40
+ const thread = assistantModal || components.includes("thread");
41
+ if (thread) {
42
+ addComponents({
43
+ '@import "@assistant-ui/react/styles/tailwindcss/base-components.css"': ""
44
+ });
45
+ addComponents({
46
+ '@import "@assistant-ui/react/styles/tailwindcss/thread.css"': ""
47
+ });
48
+ if (!shadcn) {
49
+ addComponents({
50
+ '@import "@assistant-ui/react/styles/themes/default.css"': ""
51
+ });
52
+ }
53
+ }
54
+ if (assistantModal) {
55
+ addComponents({
56
+ '@import "@assistant-ui/react/styles/tailwindcss/modal.css"': ""
57
+ });
58
+ }
59
+ },
60
+ ({ shadcn = false } = {}) => {
61
+ const prefix = !shadcn ? "--aui-" : "--";
62
+ return {
63
+ theme: {
64
+ extend: {
65
+ colors: {
66
+ aui: {
67
+ border: `hsl(var(${prefix}border))`,
68
+ input: `hsl(var(${prefix}input))`,
69
+ ring: `hsl(var(${prefix}ring))`,
70
+ background: `hsl(var(${prefix}background))`,
71
+ foreground: `hsl(var(${prefix}foreground))`,
72
+ primary: {
73
+ DEFAULT: `hsl(var(${prefix}primary))`,
74
+ foreground: `hsl(var(${prefix}primary-foreground))`
75
+ },
76
+ // secondary: {
77
+ // DEFAULT: "hsl(var(--aui-secondary))",
78
+ // foreground: "hsl(var(--aui-secondary-foreground))",
79
+ // },
80
+ // destructive: {
81
+ // DEFAULT: "hsl(var(--aui-destructive))",
82
+ // foreground: "hsl(var(--aui-destructive-foreground))",
83
+ // },
84
+ muted: {
85
+ DEFAULT: `hsl(var(${prefix}muted))`,
86
+ foreground: `hsl(var(${prefix}muted-foreground))`
87
+ },
88
+ accent: {
89
+ DEFAULT: `hsl(var(${prefix}accent))`,
90
+ foreground: `hsl(var(${prefix}accent-foreground))`
91
+ },
92
+ popover: {
93
+ DEFAULT: `hsl(var(${prefix}popover))`,
94
+ foreground: `hsl(var(${prefix}popover-foreground))`
95
+ },
96
+ card: {
97
+ DEFAULT: `hsl(var(${prefix}card))`,
98
+ foreground: `hsl(var(${prefix}card-foreground))`
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
104
+ };
105
+ }
106
+ );
107
+ var tailwindcss_default = auiPlugin;
108
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/tailwindcss/index.ts"],"sourcesContent":["import plugin from \"tailwindcss/plugin\";\n\ntype AssisstantTailwindPluginOptions = {\n components?: (\"thread\" | \"assistant-modal\")[];\n shadcn?: boolean;\n};\n\nconst auiPlugin = plugin.withOptions<AssisstantTailwindPluginOptions>(\n ({ components = [\"assistant-modal\", \"thread\"], shadcn = false } = {}) =>\n ({ addComponents }) => {\n const assistantModal = components.includes(\"assistant-modal\");\n const thread = assistantModal || components.includes(\"thread\");\n\n if (thread) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/base-components.css\"':\n \"\",\n });\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/thread.css\"': \"\",\n });\n\n if (!shadcn) {\n addComponents({\n '@import \"@assistant-ui/react/styles/themes/default.css\"': \"\",\n });\n }\n }\n\n if (assistantModal) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/modal.css\"': \"\",\n });\n }\n },\n ({ shadcn = false } = {}) => {\n const prefix = !shadcn ? \"--aui-\" : \"--\";\n return {\n theme: {\n extend: {\n colors: {\n aui: {\n border: `hsl(var(${prefix}border))`,\n input: `hsl(var(${prefix}input))`,\n ring: `hsl(var(${prefix}ring))`,\n background: `hsl(var(${prefix}background))`,\n foreground: `hsl(var(${prefix}foreground))`,\n primary: {\n DEFAULT: `hsl(var(${prefix}primary))`,\n foreground: `hsl(var(${prefix}primary-foreground))`,\n },\n // secondary: {\n // DEFAULT: \"hsl(var(--aui-secondary))\",\n // foreground: \"hsl(var(--aui-secondary-foreground))\",\n // },\n // destructive: {\n // DEFAULT: \"hsl(var(--aui-destructive))\",\n // foreground: \"hsl(var(--aui-destructive-foreground))\",\n // },\n muted: {\n DEFAULT: `hsl(var(${prefix}muted))`,\n foreground: `hsl(var(${prefix}muted-foreground))`,\n },\n accent: {\n DEFAULT: `hsl(var(${prefix}accent))`,\n foreground: `hsl(var(${prefix}accent-foreground))`,\n },\n popover: {\n DEFAULT: `hsl(var(${prefix}popover))`,\n foreground: `hsl(var(${prefix}popover-foreground))`,\n },\n card: {\n DEFAULT: `hsl(var(${prefix}card))`,\n foreground: `hsl(var(${prefix}card-foreground))`,\n },\n },\n },\n },\n },\n };\n },\n);\n\nexport default auiPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AAOnB,IAAM,YAAY,cAAAA,QAAO;AAAA,EACvB,CAAC,EAAE,aAAa,CAAC,mBAAmB,QAAQ,GAAG,SAAS,MAAM,IAAI,CAAC,MACjE,CAAC,EAAE,cAAc,MAAM;AACrB,UAAM,iBAAiB,WAAW,SAAS,iBAAiB;AAC5D,UAAM,SAAS,kBAAkB,WAAW,SAAS,QAAQ;AAE7D,QAAI,QAAQ;AACV,oBAAc;AAAA,QACZ,wEACE;AAAA,MACJ,CAAC;AACD,oBAAc;AAAA,QACZ,+DAA+D;AAAA,MACjE,CAAC;AAED,UAAI,CAAC,QAAQ;AACX,sBAAc;AAAA,UACZ,2DAA2D;AAAA,QAC7D,CAAC;AAAA,MACH;AAAA,IACF;AAEA,QAAI,gBAAgB;AAClB,oBAAc;AAAA,QACZ,8DAA8D;AAAA,MAChE,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACF,CAAC,EAAE,SAAS,MAAM,IAAI,CAAC,MAAM;AAC3B,UAAM,SAAS,CAAC,SAAS,WAAW;AACpC,WAAO;AAAA,MACL,OAAO;AAAA,QACL,QAAQ;AAAA,UACN,QAAQ;AAAA,YACN,KAAK;AAAA,cACH,QAAQ,WAAW,MAAM;AAAA,cACzB,OAAO,WAAW,MAAM;AAAA,cACxB,MAAM,WAAW,MAAM;AAAA,cACvB,YAAY,WAAW,MAAM;AAAA,cAC7B,YAAY,WAAW,MAAM;AAAA,cAC7B,SAAS;AAAA,gBACP,SAAS,WAAW,MAAM;AAAA,gBAC1B,YAAY,WAAW,MAAM;AAAA,cAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cASA,OAAO;AAAA,gBACL,SAAS,WAAW,MAAM;AAAA,gBAC1B,YAAY,WAAW,MAAM;AAAA,cAC/B;AAAA,cACA,QAAQ;AAAA,gBACN,SAAS,WAAW,MAAM;AAAA,gBAC1B,YAAY,WAAW,MAAM;AAAA,cAC/B;AAAA,cACA,SAAS;AAAA,gBACP,SAAS,WAAW,MAAM;AAAA,gBAC1B,YAAY,WAAW,MAAM;AAAA,cAC/B;AAAA,cACA,MAAM;AAAA,gBACJ,SAAS,WAAW,MAAM;AAAA,gBAC1B,YAAY,WAAW,MAAM;AAAA,cAC/B;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;","names":["plugin"]}
@@ -0,0 +1,77 @@
1
+ // src/tailwindcss/index.ts
2
+ import plugin from "tailwindcss/plugin";
3
+ var auiPlugin = plugin.withOptions(
4
+ ({ components = ["assistant-modal", "thread"], shadcn = false } = {}) => ({ addComponents }) => {
5
+ const assistantModal = components.includes("assistant-modal");
6
+ const thread = assistantModal || components.includes("thread");
7
+ if (thread) {
8
+ addComponents({
9
+ '@import "@assistant-ui/react/styles/tailwindcss/base-components.css"': ""
10
+ });
11
+ addComponents({
12
+ '@import "@assistant-ui/react/styles/tailwindcss/thread.css"': ""
13
+ });
14
+ if (!shadcn) {
15
+ addComponents({
16
+ '@import "@assistant-ui/react/styles/themes/default.css"': ""
17
+ });
18
+ }
19
+ }
20
+ if (assistantModal) {
21
+ addComponents({
22
+ '@import "@assistant-ui/react/styles/tailwindcss/modal.css"': ""
23
+ });
24
+ }
25
+ },
26
+ ({ shadcn = false } = {}) => {
27
+ const prefix = !shadcn ? "--aui-" : "--";
28
+ return {
29
+ theme: {
30
+ extend: {
31
+ colors: {
32
+ aui: {
33
+ border: `hsl(var(${prefix}border))`,
34
+ input: `hsl(var(${prefix}input))`,
35
+ ring: `hsl(var(${prefix}ring))`,
36
+ background: `hsl(var(${prefix}background))`,
37
+ foreground: `hsl(var(${prefix}foreground))`,
38
+ primary: {
39
+ DEFAULT: `hsl(var(${prefix}primary))`,
40
+ foreground: `hsl(var(${prefix}primary-foreground))`
41
+ },
42
+ // secondary: {
43
+ // DEFAULT: "hsl(var(--aui-secondary))",
44
+ // foreground: "hsl(var(--aui-secondary-foreground))",
45
+ // },
46
+ // destructive: {
47
+ // DEFAULT: "hsl(var(--aui-destructive))",
48
+ // foreground: "hsl(var(--aui-destructive-foreground))",
49
+ // },
50
+ muted: {
51
+ DEFAULT: `hsl(var(${prefix}muted))`,
52
+ foreground: `hsl(var(${prefix}muted-foreground))`
53
+ },
54
+ accent: {
55
+ DEFAULT: `hsl(var(${prefix}accent))`,
56
+ foreground: `hsl(var(${prefix}accent-foreground))`
57
+ },
58
+ popover: {
59
+ DEFAULT: `hsl(var(${prefix}popover))`,
60
+ foreground: `hsl(var(${prefix}popover-foreground))`
61
+ },
62
+ card: {
63
+ DEFAULT: `hsl(var(${prefix}card))`,
64
+ foreground: `hsl(var(${prefix}card-foreground))`
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ };
71
+ }
72
+ );
73
+ var tailwindcss_default = auiPlugin;
74
+ export {
75
+ tailwindcss_default as default
76
+ };
77
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/tailwindcss/index.ts"],"sourcesContent":["import plugin from \"tailwindcss/plugin\";\n\ntype AssisstantTailwindPluginOptions = {\n components?: (\"thread\" | \"assistant-modal\")[];\n shadcn?: boolean;\n};\n\nconst auiPlugin = plugin.withOptions<AssisstantTailwindPluginOptions>(\n ({ components = [\"assistant-modal\", \"thread\"], shadcn = false } = {}) =>\n ({ addComponents }) => {\n const assistantModal = components.includes(\"assistant-modal\");\n const thread = assistantModal || components.includes(\"thread\");\n\n if (thread) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/base-components.css\"':\n \"\",\n });\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/thread.css\"': \"\",\n });\n\n if (!shadcn) {\n addComponents({\n '@import \"@assistant-ui/react/styles/themes/default.css\"': \"\",\n });\n }\n }\n\n if (assistantModal) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/modal.css\"': \"\",\n });\n }\n },\n ({ shadcn = false } = {}) => {\n const prefix = !shadcn ? \"--aui-\" : \"--\";\n return {\n theme: {\n extend: {\n colors: {\n aui: {\n border: `hsl(var(${prefix}border))`,\n input: `hsl(var(${prefix}input))`,\n ring: `hsl(var(${prefix}ring))`,\n background: `hsl(var(${prefix}background))`,\n foreground: `hsl(var(${prefix}foreground))`,\n primary: {\n DEFAULT: `hsl(var(${prefix}primary))`,\n foreground: `hsl(var(${prefix}primary-foreground))`,\n },\n // secondary: {\n // DEFAULT: \"hsl(var(--aui-secondary))\",\n // foreground: \"hsl(var(--aui-secondary-foreground))\",\n // },\n // destructive: {\n // DEFAULT: \"hsl(var(--aui-destructive))\",\n // foreground: \"hsl(var(--aui-destructive-foreground))\",\n // },\n muted: {\n DEFAULT: `hsl(var(${prefix}muted))`,\n foreground: `hsl(var(${prefix}muted-foreground))`,\n },\n accent: {\n DEFAULT: `hsl(var(${prefix}accent))`,\n foreground: `hsl(var(${prefix}accent-foreground))`,\n },\n popover: {\n DEFAULT: `hsl(var(${prefix}popover))`,\n foreground: `hsl(var(${prefix}popover-foreground))`,\n },\n card: {\n DEFAULT: `hsl(var(${prefix}card))`,\n foreground: `hsl(var(${prefix}card-foreground))`,\n },\n },\n },\n },\n },\n };\n },\n);\n\nexport default auiPlugin;\n"],"mappings":";AAAA,OAAO,YAAY;AAOnB,IAAM,YAAY,OAAO;AAAA,EACvB,CAAC,EAAE,aAAa,CAAC,mBAAmB,QAAQ,GAAG,SAAS,MAAM,IAAI,CAAC,MACjE,CAAC,EA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W,MAAM;AAAA,cAC/B;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;","names":[]}
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "conversational-ui",
30
30
  "conversational-ai"
31
31
  ],
32
- "version": "0.3.4",
32
+ "version": "0.4.0",
33
33
  "license": "MIT",
34
34
  "exports": {
35
35
  ".": {
@@ -41,6 +41,29 @@
41
41
  "types": "./dist/index.d.ts",
42
42
  "default": "./dist/index.js"
43
43
  }
44
+ },
45
+ "./edge": {
46
+ "import": {
47
+ "types": "./dist/edge.d.mts",
48
+ "default": "./dist/edge.mjs"
49
+ },
50
+ "require": {
51
+ "types": "./dist/edge.d.ts",
52
+ "default": "./dist/edge.js"
53
+ }
54
+ },
55
+ "./tailwindcss": {
56
+ "import": {
57
+ "types": "./dist/tailwindcss/index.d.mts",
58
+ "default": "./dist/tailwindcss/index.mjs"
59
+ },
60
+ "require": {
61
+ "types": "./dist/tailwindcss/index.d.ts",
62
+ "default": "./dist/tailwindcss/index.js"
63
+ }
64
+ },
65
+ "./styles/*": {
66
+ "default": "./dist/styles/*"
44
67
  }
45
68
  },
46
69
  "source": "./src/index.ts",
@@ -53,25 +76,34 @@
53
76
  ],
54
77
  "sideEffects": false,
55
78
  "dependencies": {
79
+ "@ai-sdk/provider": "^0.0.12",
56
80
  "@radix-ui/primitive": "^1.1.0",
81
+ "@radix-ui/react-avatar": "^1.1.0",
57
82
  "@radix-ui/react-compose-refs": "^1.1.0",
58
83
  "@radix-ui/react-context": "^1.1.0",
59
84
  "@radix-ui/react-popover": "^1.1.1",
60
85
  "@radix-ui/react-primitive": "^2.0.0",
61
86
  "@radix-ui/react-slot": "^1.1.0",
87
+ "@radix-ui/react-tooltip": "^1.1.2",
62
88
  "@radix-ui/react-use-callback-ref": "^1.1.0",
63
89
  "@radix-ui/react-use-escape-keydown": "^1.1.0",
64
- "@radix-ui/react-use-layout-effect": "^1.1.0",
90
+ "class-variance-authority": "^0.7.0",
91
+ "classnames": "^2.5.1",
92
+ "json-schema": "^0.4.0",
93
+ "lucide-react": "^0.407.0",
65
94
  "nanoid": "^5.0.7",
66
95
  "react-textarea-autosize": "^8.5.3",
96
+ "secure-json-parse": "^2.7.0",
67
97
  "zod": "^3.23.8",
98
+ "zod-to-json-schema": "^3.23.1",
68
99
  "zustand": "^4.5.4"
69
100
  },
70
101
  "peerDependencies": {
71
102
  "@types/react": "*",
72
103
  "@types/react-dom": "*",
73
104
  "react": "^18",
74
- "react-dom": "^18"
105
+ "react-dom": "^18",
106
+ "tailwindcss": "^3.4.4"
75
107
  },
76
108
  "peerDependenciesMeta": {
77
109
  "@types/react": {
@@ -79,12 +111,23 @@
79
111
  },
80
112
  "@types/react-dom": {
81
113
  "optional": true
114
+ },
115
+ "tailwindcss": {
116
+ "optional": true
82
117
  }
83
118
  },
84
119
  "devDependencies": {
85
- "@ai-sdk/react": "^0.0.16",
86
- "@types/node": "^20.14.9",
120
+ "@types/json-schema": "^7.0.15",
121
+ "@types/node": "^20.14.10",
122
+ "autoprefixer": "^10.4.19",
123
+ "eslint-config-next": "14.2.5",
124
+ "postcss": "^8.4.39",
125
+ "postcss-nested": "^6.0.1",
126
+ "tailwindcss": "^3.4.4",
127
+ "tailwindcss-animate": "^1.0.7",
87
128
  "tsup": "^8.1.0",
129
+ "tsx": "^4.16.2",
130
+ "@assistant-ui/tailwindcss-transformer": "0.1.0",
88
131
  "@assistant-ui/tsconfig": "0.0.0"
89
132
  },
90
133
  "publishConfig": {
@@ -100,6 +143,6 @@
100
143
  "url": "https://github.com/Yonom/assistant-ui/issues"
101
144
  },
102
145
  "scripts": {
103
- "build": "tsup src/index.ts --format cjs,esm --dts --sourcemap"
146
+ "build": "tsx scripts/build.mts"
104
147
  }
105
148
  }