@assistant-ui/react 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,43 @@
1
1
  import * as tailwindcss_types_config from 'tailwindcss/types/config';
2
2
 
3
+ type AssistantTailwindPluginColors = {
4
+ border: string;
5
+ input: string;
6
+ ring: string;
7
+ background: string;
8
+ foreground: string;
9
+ primary: {
10
+ DEFAULT: string;
11
+ foreground: string;
12
+ };
13
+ secondary: {
14
+ DEFAULT: string;
15
+ foreground: string;
16
+ };
17
+ destructive: {
18
+ DEFAULT: string;
19
+ foreground: string;
20
+ };
21
+ muted: {
22
+ DEFAULT: string;
23
+ foreground: string;
24
+ };
25
+ accent: {
26
+ DEFAULT: string;
27
+ foreground: string;
28
+ };
29
+ popover: {
30
+ DEFAULT: string;
31
+ foreground: string;
32
+ };
33
+ card: {
34
+ DEFAULT: string;
35
+ foreground: string;
36
+ };
37
+ };
3
38
  type AssisstantTailwindPluginOptions = {
4
39
  components?: ("default-theme" | "base" | "thread" | "assistant-modal")[];
40
+ colors?: AssistantTailwindPluginColors;
5
41
  shadcn?: boolean;
6
42
  };
7
43
  declare const auiPlugin: {
@@ -1,7 +1,43 @@
1
1
  import * as tailwindcss_types_config from 'tailwindcss/types/config';
2
2
 
3
+ type AssistantTailwindPluginColors = {
4
+ border: string;
5
+ input: string;
6
+ ring: string;
7
+ background: string;
8
+ foreground: string;
9
+ primary: {
10
+ DEFAULT: string;
11
+ foreground: string;
12
+ };
13
+ secondary: {
14
+ DEFAULT: string;
15
+ foreground: string;
16
+ };
17
+ destructive: {
18
+ DEFAULT: string;
19
+ foreground: string;
20
+ };
21
+ muted: {
22
+ DEFAULT: string;
23
+ foreground: string;
24
+ };
25
+ accent: {
26
+ DEFAULT: string;
27
+ foreground: string;
28
+ };
29
+ popover: {
30
+ DEFAULT: string;
31
+ foreground: string;
32
+ };
33
+ card: {
34
+ DEFAULT: string;
35
+ foreground: string;
36
+ };
37
+ };
3
38
  type AssisstantTailwindPluginOptions = {
4
39
  components?: ("default-theme" | "base" | "thread" | "assistant-modal")[];
40
+ colors?: AssistantTailwindPluginColors;
5
41
  shadcn?: boolean;
6
42
  };
7
43
  declare const auiPlugin: {
@@ -63,45 +63,45 @@ var auiPlugin = import_plugin.default.withOptions(
63
63
  });
64
64
  }
65
65
  },
66
- ({ shadcn = false } = {}) => {
66
+ ({ shadcn = false, colors = {} } = {}) => {
67
67
  const prefix = !shadcn ? "--aui-" : "--";
68
68
  return {
69
69
  theme: {
70
70
  extend: {
71
71
  colors: {
72
72
  aui: {
73
- border: `hsl(var(${prefix}border))`,
74
- input: `hsl(var(${prefix}input))`,
75
- ring: `hsl(var(${prefix}ring))`,
76
- background: `hsl(var(${prefix}background))`,
77
- foreground: `hsl(var(${prefix}foreground))`,
73
+ border: colors.border ?? `hsl(var(${prefix}border))`,
74
+ input: colors.input ?? `hsl(var(${prefix}input))`,
75
+ ring: colors.ring ?? `hsl(var(${prefix}ring))`,
76
+ background: colors.background ?? `hsl(var(${prefix}background))`,
77
+ foreground: colors.foreground ?? `hsl(var(${prefix}foreground))`,
78
78
  primary: {
79
- DEFAULT: `hsl(var(${prefix}primary))`,
80
- foreground: `hsl(var(${prefix}primary-foreground))`
79
+ DEFAULT: colors.primary?.DEFAULT ?? `hsl(var(${prefix}primary))`,
80
+ foreground: colors.primary?.foreground ?? `hsl(var(${prefix}primary-foreground))`
81
81
  },
82
82
  secondary: {
83
- DEFAULT: `hsl(var(${prefix}secondary))`,
84
- foreground: `hsl(var(${prefix}secondary-foreground))`
83
+ DEFAULT: colors.secondary?.DEFAULT ?? `hsl(var(${prefix}secondary))`,
84
+ foreground: colors.secondary?.foreground ?? `hsl(var(${prefix}secondary-foreground))`
85
85
  },
86
86
  destructive: {
87
- DEFAULT: `hsl(var(${prefix}destructive))`,
87
+ DEFAULT: colors.destructive?.DEFAULT ?? `hsl(var(${prefix}destructive))`,
88
88
  foreground: `hsl(var(${prefix}destructive-foreground))`
89
89
  },
90
90
  muted: {
91
91
  DEFAULT: `hsl(var(${prefix}muted))`,
92
- foreground: `hsl(var(${prefix}muted-foreground))`
92
+ foreground: colors.muted?.foreground ?? `hsl(var(${prefix}muted-foreground))`
93
93
  },
94
94
  accent: {
95
- DEFAULT: `hsl(var(${prefix}accent))`,
96
- foreground: `hsl(var(${prefix}accent-foreground))`
95
+ DEFAULT: colors.accent?.DEFAULT ?? `hsl(var(${prefix}accent))`,
96
+ foreground: colors.accent?.foreground ?? `hsl(var(${prefix}accent-foreground))`
97
97
  },
98
98
  popover: {
99
- DEFAULT: `hsl(var(${prefix}popover))`,
100
- foreground: `hsl(var(${prefix}popover-foreground))`
99
+ DEFAULT: colors.popover?.DEFAULT ?? `hsl(var(${prefix}popover))`,
100
+ foreground: colors.popover?.foreground ?? `hsl(var(${prefix}popover-foreground))`
101
101
  },
102
102
  card: {
103
- DEFAULT: `hsl(var(${prefix}card))`,
104
- foreground: `hsl(var(${prefix}card-foreground))`
103
+ DEFAULT: colors.card?.DEFAULT ?? `hsl(var(${prefix}card))`,
104
+ foreground: colors.card?.foreground ?? `hsl(var(${prefix}card-foreground))`
105
105
  }
106
106
  }
107
107
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tailwindcss/index.ts"],"sourcesContent":["import plugin from \"tailwindcss/plugin\";\n\ntype AssisstantTailwindPluginOptions = {\n components?: (\"default-theme\" | \"base\" | \"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 const base = thread || components.includes(\"base\");\n const defaultTheme = components.includes(\"default-theme\");\n\n if (defaultTheme && shadcn)\n throw new Error(\"default-theme cannot be used with shadcn\");\n\n if (defaultTheme || (base && !shadcn)) {\n addComponents({\n '@import \"@assistant-ui/react/styles/themes/default.css\"': \"\",\n });\n }\n\n if (base) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/base-components.css\"':\n \"\",\n });\n }\n\n if (thread) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/thread.css\"': \"\",\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(${prefix}secondary))`,\n foreground: `hsl(var(${prefix}secondary-foreground))`,\n },\n destructive: {\n DEFAULT: `hsl(var(${prefix}destructive))`,\n foreground: `hsl(var(${prefix}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,EAA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AW,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"]}
1
+ {"version":3,"sources":["../../src/tailwindcss/index.ts"],"sourcesContent":["import plugin from \"tailwindcss/plugin\";\n\ntype AssistantTailwindPluginColors = {\n border: string;\n input: string;\n ring: string;\n background: string;\n foreground: string;\n primary: {\n DEFAULT: string;\n foreground: string;\n };\n secondary: {\n DEFAULT: string;\n foreground: string;\n };\n destructive: {\n DEFAULT: string;\n foreground: string;\n };\n muted: {\n DEFAULT: string;\n foreground: string;\n };\n accent: {\n DEFAULT: string;\n foreground: string;\n };\n popover: {\n DEFAULT: string;\n foreground: string;\n };\n card: {\n DEFAULT: string;\n foreground: string;\n };\n};\n\ntype AssisstantTailwindPluginOptions = {\n components?: (\"default-theme\" | \"base\" | \"thread\" | \"assistant-modal\")[];\n colors?: AssistantTailwindPluginColors;\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 const base = thread || components.includes(\"base\");\n const defaultTheme = components.includes(\"default-theme\");\n\n if (defaultTheme && shadcn)\n throw new Error(\"default-theme cannot be used with shadcn\");\n\n if (defaultTheme || (base && !shadcn)) {\n addComponents({\n '@import \"@assistant-ui/react/styles/themes/default.css\"': \"\",\n });\n }\n\n if (base) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/base-components.css\"':\n \"\",\n });\n }\n\n if (thread) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/thread.css\"': \"\",\n });\n }\n\n if (assistantModal) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/modal.css\"': \"\",\n });\n }\n },\n ({ shadcn = false, colors = {} } = {}) => {\n const prefix = !shadcn ? \"--aui-\" : \"--\";\n return {\n theme: {\n extend: {\n colors: {\n aui: {\n border: colors.border ?? `hsl(var(${prefix}border))`,\n input: colors.input ?? `hsl(var(${prefix}input))`,\n ring: colors.ring ?? `hsl(var(${prefix}ring))`,\n background: colors.background ?? `hsl(var(${prefix}background))`,\n foreground: colors.foreground ?? `hsl(var(${prefix}foreground))`,\n primary: {\n DEFAULT:\n colors.primary?.DEFAULT ?? `hsl(var(${prefix}primary))`,\n foreground:\n colors.primary?.foreground ??\n `hsl(var(${prefix}primary-foreground))`,\n },\n secondary: {\n DEFAULT:\n colors.secondary?.DEFAULT ?? `hsl(var(${prefix}secondary))`,\n foreground:\n colors.secondary?.foreground ??\n `hsl(var(${prefix}secondary-foreground))`,\n },\n destructive: {\n DEFAULT:\n colors.destructive?.DEFAULT ??\n `hsl(var(${prefix}destructive))`,\n foreground: `hsl(var(${prefix}destructive-foreground))`,\n },\n muted: {\n DEFAULT: `hsl(var(${prefix}muted))`,\n foreground:\n colors.muted?.foreground ??\n `hsl(var(${prefix}muted-foreground))`,\n },\n accent: {\n DEFAULT: colors.accent?.DEFAULT ?? `hsl(var(${prefix}accent))`,\n foreground:\n colors.accent?.foreground ??\n `hsl(var(${prefix}accent-foreground))`,\n },\n popover: {\n DEFAULT:\n colors.popover?.DEFAULT ?? `hsl(var(${prefix}popover))`,\n foreground:\n colors.popover?.foreground ??\n `hsl(var(${prefix}popover-foreground))`,\n },\n card: {\n DEFAULT: colors.card?.DEFAULT ?? `hsl(var(${prefix}card))`,\n foreground:\n colors.card?.foreground ??\n `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;AA4CnB,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;AAC7D,UAAM,OAAO,UAAU,WAAW,SAAS,MAAM;AACjD,UAAM,eAAe,WAAW,SAAS,eAAe;AAExD,QAAI,gBAAgB;AAClB,YAAM,IAAI,MAAM,0CAA0C;AAE5D,QAAI,gBAAiB,QAAQ,CAAC,QAAS;AACrC,oBAAc;AAAA,QACZ,2DAA2D;AAAA,MAC7D,CAAC;AAAA,IACH;AAEA,QAAI,MAAM;AACR,oBAAc;AAAA,QACZ,wEACE;AAAA,MACJ,CAAC;AAAA,IACH;AAEA,QAAI,QAAQ;AACV,oBAAc;AAAA,QACZ,+DAA+D;AAAA,MACjE,CAAC;AAAA,IACH;AAEA,QAAI,gBAAgB;AAClB,oBAAc;AAAA,QACZ,8DAA8D;AAAA,MAChE,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACF,CAAC,EAAE,SAAS,OAAO,SAAS,CAAC,EAAE,IAAI,CAAC,MAAM;AACxC,UAAM,SAAS,CAAC,SAAS,WAAW;AACpC,WAAO;AAAA,MACL,OAAO;AAAA,QACL,QAAQ;AAAA,UACN,QAAQ;AAAA,YACN,KAAK;AAAA,cACH,QAAQ,OAAO,UAAU,WAAW,MAAM;AAAA,cAC1C,OAAO,OAAO,SAAS,WAAW,MAAM;AAAA,cACxC,MAAM,OAAO,QAAQ,WAAW,MAAM;AAAA,cACtC,YAAY,OAAO,cAAc,WAAW,MAAM;AAAA,cAClD,YAAY,OAAO,cAAc,WAAW,MAAM;AAAA,cAClD,SAAS;AAAA,gBACP,SACE,OAAO,SAAS,WAAW,WAAW,MAAM;AAAA,gBAC9C,YACE,OAAO,SAAS,cAChB,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,WAAW;AAAA,gBACT,SACE,OAAO,WAAW,WAAW,WAAW,MAAM;AAAA,gBAChD,YACE,OAAO,WAAW,cAClB,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,aAAa;AAAA,gBACX,SACE,OAAO,aAAa,WACpB,WAAW,MAAM;AAAA,gBACnB,YAAY,WAAW,MAAM;AAAA,cAC/B;AAAA,cACA,OAAO;AAAA,gBACL,SAAS,WAAW,MAAM;AAAA,gBAC1B,YACE,OAAO,OAAO,cACd,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,QAAQ;AAAA,gBACN,SAAS,OAAO,QAAQ,WAAW,WAAW,MAAM;AAAA,gBACpD,YACE,OAAO,QAAQ,cACf,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,SAAS;AAAA,gBACP,SACE,OAAO,SAAS,WAAW,WAAW,MAAM;AAAA,gBAC9C,YACE,OAAO,SAAS,cAChB,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,MAAM;AAAA,gBACJ,SAAS,OAAO,MAAM,WAAW,WAAW,MAAM;AAAA,gBAClD,YACE,OAAO,MAAM,cACb,WAAW,MAAM;AAAA,cACrB;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;","names":["plugin"]}
@@ -29,45 +29,45 @@ var auiPlugin = plugin.withOptions(
29
29
  });
30
30
  }
31
31
  },
32
- ({ shadcn = false } = {}) => {
32
+ ({ shadcn = false, colors = {} } = {}) => {
33
33
  const prefix = !shadcn ? "--aui-" : "--";
34
34
  return {
35
35
  theme: {
36
36
  extend: {
37
37
  colors: {
38
38
  aui: {
39
- border: `hsl(var(${prefix}border))`,
40
- input: `hsl(var(${prefix}input))`,
41
- ring: `hsl(var(${prefix}ring))`,
42
- background: `hsl(var(${prefix}background))`,
43
- foreground: `hsl(var(${prefix}foreground))`,
39
+ border: colors.border ?? `hsl(var(${prefix}border))`,
40
+ input: colors.input ?? `hsl(var(${prefix}input))`,
41
+ ring: colors.ring ?? `hsl(var(${prefix}ring))`,
42
+ background: colors.background ?? `hsl(var(${prefix}background))`,
43
+ foreground: colors.foreground ?? `hsl(var(${prefix}foreground))`,
44
44
  primary: {
45
- DEFAULT: `hsl(var(${prefix}primary))`,
46
- foreground: `hsl(var(${prefix}primary-foreground))`
45
+ DEFAULT: colors.primary?.DEFAULT ?? `hsl(var(${prefix}primary))`,
46
+ foreground: colors.primary?.foreground ?? `hsl(var(${prefix}primary-foreground))`
47
47
  },
48
48
  secondary: {
49
- DEFAULT: `hsl(var(${prefix}secondary))`,
50
- foreground: `hsl(var(${prefix}secondary-foreground))`
49
+ DEFAULT: colors.secondary?.DEFAULT ?? `hsl(var(${prefix}secondary))`,
50
+ foreground: colors.secondary?.foreground ?? `hsl(var(${prefix}secondary-foreground))`
51
51
  },
52
52
  destructive: {
53
- DEFAULT: `hsl(var(${prefix}destructive))`,
53
+ DEFAULT: colors.destructive?.DEFAULT ?? `hsl(var(${prefix}destructive))`,
54
54
  foreground: `hsl(var(${prefix}destructive-foreground))`
55
55
  },
56
56
  muted: {
57
57
  DEFAULT: `hsl(var(${prefix}muted))`,
58
- foreground: `hsl(var(${prefix}muted-foreground))`
58
+ foreground: colors.muted?.foreground ?? `hsl(var(${prefix}muted-foreground))`
59
59
  },
60
60
  accent: {
61
- DEFAULT: `hsl(var(${prefix}accent))`,
62
- foreground: `hsl(var(${prefix}accent-foreground))`
61
+ DEFAULT: colors.accent?.DEFAULT ?? `hsl(var(${prefix}accent))`,
62
+ foreground: colors.accent?.foreground ?? `hsl(var(${prefix}accent-foreground))`
63
63
  },
64
64
  popover: {
65
- DEFAULT: `hsl(var(${prefix}popover))`,
66
- foreground: `hsl(var(${prefix}popover-foreground))`
65
+ DEFAULT: colors.popover?.DEFAULT ?? `hsl(var(${prefix}popover))`,
66
+ foreground: colors.popover?.foreground ?? `hsl(var(${prefix}popover-foreground))`
67
67
  },
68
68
  card: {
69
- DEFAULT: `hsl(var(${prefix}card))`,
70
- foreground: `hsl(var(${prefix}card-foreground))`
69
+ DEFAULT: colors.card?.DEFAULT ?? `hsl(var(${prefix}card))`,
70
+ foreground: colors.card?.foreground ?? `hsl(var(${prefix}card-foreground))`
71
71
  }
72
72
  }
73
73
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tailwindcss/index.ts"],"sourcesContent":["import plugin from \"tailwindcss/plugin\";\n\ntype AssisstantTailwindPluginOptions = {\n components?: (\"default-theme\" | \"base\" | \"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 const base = thread || components.includes(\"base\");\n const defaultTheme = components.includes(\"default-theme\");\n\n if (defaultTheme && shadcn)\n throw new Error(\"default-theme cannot be used with shadcn\");\n\n if (defaultTheme || (base && !shadcn)) {\n addComponents({\n '@import \"@assistant-ui/react/styles/themes/default.css\"': \"\",\n });\n }\n\n if (base) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/base-components.css\"':\n \"\",\n });\n }\n\n if (thread) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/thread.css\"': \"\",\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(${prefix}secondary))`,\n foreground: `hsl(var(${prefix}secondary-foreground))`,\n },\n destructive: {\n DEFAULT: `hsl(var(${prefix}destructive))`,\n foreground: `hsl(var(${prefix}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,EAAE,cAAc,MAAM;AACrB,UAAM,iBAAiB,WAAW,SAAS,iBAAiB;AAC5D,UAAM,SAAS,kBAAkB,WAAW,SAAS,QAAQ;AAC7D,UAAM,OAAO,UAAU,WAAW,SAAS,MAAM;AACjD,UAAM,eAAe,WAAW,SAAS,eAAe;AAExD,QAAI,gBAAgB;AAClB,YAAM,IAAI,MAAM,0CAA0C;AAE5D,QAAI,gBAAiB,QAAQ,CAAC,QAAS;AACrC,oBAAc;AAAA,QACZ,2DAA2D;AAAA,MAC7D,CAAC;AAAA,IACH;AAEA,QAAI,M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UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;","names":[]}
1
+ {"version":3,"sources":["../../src/tailwindcss/index.ts"],"sourcesContent":["import plugin from \"tailwindcss/plugin\";\n\ntype AssistantTailwindPluginColors = {\n border: string;\n input: string;\n ring: string;\n background: string;\n foreground: string;\n primary: {\n DEFAULT: string;\n foreground: string;\n };\n secondary: {\n DEFAULT: string;\n foreground: string;\n };\n destructive: {\n DEFAULT: string;\n foreground: string;\n };\n muted: {\n DEFAULT: string;\n foreground: string;\n };\n accent: {\n DEFAULT: string;\n foreground: string;\n };\n popover: {\n DEFAULT: string;\n foreground: string;\n };\n card: {\n DEFAULT: string;\n foreground: string;\n };\n};\n\ntype AssisstantTailwindPluginOptions = {\n components?: (\"default-theme\" | \"base\" | \"thread\" | \"assistant-modal\")[];\n colors?: AssistantTailwindPluginColors;\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 const base = thread || components.includes(\"base\");\n const defaultTheme = components.includes(\"default-theme\");\n\n if (defaultTheme && shadcn)\n throw new Error(\"default-theme cannot be used with shadcn\");\n\n if (defaultTheme || (base && !shadcn)) {\n addComponents({\n '@import \"@assistant-ui/react/styles/themes/default.css\"': \"\",\n });\n }\n\n if (base) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/base-components.css\"':\n \"\",\n });\n }\n\n if (thread) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/thread.css\"': \"\",\n });\n }\n\n if (assistantModal) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/modal.css\"': \"\",\n });\n }\n },\n ({ shadcn = false, colors = {} } = {}) => {\n const prefix = !shadcn ? \"--aui-\" : \"--\";\n return {\n theme: {\n extend: {\n colors: {\n aui: {\n border: colors.border ?? `hsl(var(${prefix}border))`,\n input: colors.input ?? `hsl(var(${prefix}input))`,\n ring: colors.ring ?? `hsl(var(${prefix}ring))`,\n background: colors.background ?? `hsl(var(${prefix}background))`,\n foreground: colors.foreground ?? `hsl(var(${prefix}foreground))`,\n primary: {\n DEFAULT:\n colors.primary?.DEFAULT ?? `hsl(var(${prefix}primary))`,\n foreground:\n colors.primary?.foreground ??\n `hsl(var(${prefix}primary-foreground))`,\n },\n secondary: {\n DEFAULT:\n colors.secondary?.DEFAULT ?? `hsl(var(${prefix}secondary))`,\n foreground:\n colors.secondary?.foreground ??\n `hsl(var(${prefix}secondary-foreground))`,\n },\n destructive: {\n DEFAULT:\n colors.destructive?.DEFAULT ??\n `hsl(var(${prefix}destructive))`,\n foreground: `hsl(var(${prefix}destructive-foreground))`,\n },\n muted: {\n DEFAULT: `hsl(var(${prefix}muted))`,\n foreground:\n colors.muted?.foreground ??\n `hsl(var(${prefix}muted-foreground))`,\n },\n accent: {\n DEFAULT: colors.accent?.DEFAULT ?? `hsl(var(${prefix}accent))`,\n foreground:\n colors.accent?.foreground ??\n `hsl(var(${prefix}accent-foreground))`,\n },\n popover: {\n DEFAULT:\n colors.popover?.DEFAULT ?? `hsl(var(${prefix}popover))`,\n foreground:\n colors.popover?.foreground ??\n `hsl(var(${prefix}popover-foreground))`,\n },\n card: {\n DEFAULT: colors.card?.DEFAULT ?? `hsl(var(${prefix}card))`,\n foreground:\n colors.card?.foreground ??\n `hsl(var(${prefix}card-foreground))`,\n },\n },\n },\n },\n },\n };\n },\n);\n\nexport default auiPlugin;\n"],"mappings":";AAAA,OAAO,YAAY;AA4CnB,IAAM,YAAY,OAAO;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,SA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AM;AAAA,gBACnB,YAAY,WAAW,MAAM;AAAA,cAC/B;AAAA,cACA,OAAO;AAAA,gBACL,SAAS,WAAW,MAAM;AAAA,gBAC1B,YACE,OAAO,OAAO,cACd,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,QAAQ;AAAA,gBACN,SAAS,OAAO,QAAQ,WAAW,WAAW,MAAM;AAAA,gBACpD,YACE,OAAO,QAAQ,cACf,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,SAAS;AAAA,gBACP,SACE,OAAO,SAAS,WAAW,WAAW,MAAM;AAAA,gBAC9C,YACE,OAAO,SAAS,cAChB,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,MAAM;AAAA,gBACJ,SAAS,OAAO,MAAM,WAAW,WAAW,MAAM;AAAA,gBAClD,YACE,OAAO,MAAM,cACb,WAAW,MAAM;AAAA,cACrB;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.5.9",
32
+ "version": "0.5.10",
33
33
  "license": "MIT",
34
34
  "exports": {
35
35
  ".": {