@peak-ai/canvas 1.4.21 → 1.4.22

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.
Files changed (213) hide show
  1. package/.babelrc +14 -0
  2. package/.eslintcache +1 -0
  3. package/.eslintignore +5 -0
  4. package/.eslintrc.js +29 -0
  5. package/{GrapesjsCanvas.js → dist/GrapesjsCanvas.js} +3 -2
  6. package/dist/GrapesjsCanvas.js.map +1 -0
  7. package/dist/package.json +62 -0
  8. package/{plugins → dist/plugins}/helpers/render-components.js +1 -1
  9. package/dist/plugins/helpers/render-components.js.map +1 -0
  10. package/dist/shadcn/components/ui/error-wrapper.js +2 -0
  11. package/dist/shadcn/components/ui/error-wrapper.js.map +1 -0
  12. package/package.json +45 -7
  13. package/scripts/build.ts +120 -0
  14. package/src/GrapesjsCanvas.tsx +494 -0
  15. package/src/constants/index.ts +25 -0
  16. package/src/declaration.d.ts +1 -0
  17. package/src/helpers/compiled-table.css +2429 -0
  18. package/src/helpers/css.ts +2667 -0
  19. package/src/helpers/date-picker.ts +807 -0
  20. package/src/helpers/filter-placeholder.ts +18 -0
  21. package/src/helpers/index.ts +13 -0
  22. package/src/helpers/merge-json.ts +106 -0
  23. package/src/index.styles.ts +58 -0
  24. package/src/index.ts +9 -0
  25. package/src/plugins/grapejs-plugin.tsx +196 -0
  26. package/src/plugins/helpers/custom-modal.tsx +123 -0
  27. package/src/plugins/helpers/data-table.tsx +300 -0
  28. package/src/plugins/helpers/extra.tsx +164 -0
  29. package/src/plugins/helpers/query-cache-context.tsx +154 -0
  30. package/src/plugins/helpers/query-cache-singleton.ts +176 -0
  31. package/src/plugins/helpers/query-cache-utils.ts +226 -0
  32. package/src/plugins/helpers/query-details-modal.tsx +400 -0
  33. package/src/plugins/helpers/query-heading-formatter.ts +24 -0
  34. package/src/plugins/helpers/query-loading-modal.tsx +94 -0
  35. package/src/plugins/helpers/render-components.tsx +1450 -0
  36. package/src/plugins/helpers/styled-info-button.tsx +504 -0
  37. package/src/public/canvas.css +42 -0
  38. package/src/public/components-css/table/table-output.css +2436 -0
  39. package/src/public/components-css/table/table.css +30 -0
  40. package/src/public/output.css +2465 -0
  41. package/src/public/table.css +135 -0
  42. package/src/shadcn/components/icons/AiAvatarIcon.tsx +47 -0
  43. package/src/shadcn/components/icons/Co_driver Expanding button copy.svg +21 -0
  44. package/src/shadcn/components/icons/ai-avatar.svg +7 -0
  45. package/src/shadcn/components/icons/thinking.gif +0 -0
  46. package/src/shadcn/components/ui/button.tsx +132 -0
  47. package/src/shadcn/components/ui/card.tsx +92 -0
  48. package/src/shadcn/components/ui/chart.tsx +324 -0
  49. package/src/shadcn/components/ui/checkbox.tsx +27 -0
  50. package/src/shadcn/components/ui/component-wrapper.tsx +61 -0
  51. package/src/shadcn/components/ui/date-filter.tsx +816 -0
  52. package/src/shadcn/components/ui/error-container.tsx +125 -0
  53. package/src/shadcn/components/ui/error-wrapper.tsx +99 -0
  54. package/src/shadcn/components/ui/filter.tsx +368 -0
  55. package/src/shadcn/components/ui/hover-card.tsx +36 -0
  56. package/src/shadcn/components/ui/input.tsx +20 -0
  57. package/src/shadcn/components/ui/label.tsx +24 -0
  58. package/src/shadcn/components/ui/pagination.tsx +213 -0
  59. package/src/shadcn/components/ui/scroll-area.tsx +59 -0
  60. package/src/shadcn/components/ui/search.tsx +150 -0
  61. package/src/shadcn/components/ui/separator.tsx +26 -0
  62. package/src/shadcn/components/ui/skeleton.tsx +69 -0
  63. package/src/shadcn/components/ui/table.tsx +196 -0
  64. package/src/shadcn/components/ui/tabs.tsx +55 -0
  65. package/src/shadcn/components/ui/textarea.tsx +18 -0
  66. package/src/shadcn/components/ui/tooltip.tsx +87 -0
  67. package/src/shadcn/utils.ts +6 -0
  68. package/src/types/grapesjs-tailwind.d.ts +61 -0
  69. package/src/types/images.d.ts +1 -0
  70. package/tailwind.config.js +5 -0
  71. package/tooling/tailwind-compiler/index.js +99 -0
  72. package/tooling/tailwind-compiler/package.json +11 -0
  73. package/tooling/tailwind-compiler/yarn.lock +123 -0
  74. package/tsconfig.build.json +15 -0
  75. package/tsconfig.json +8 -0
  76. package/GrapesjsCanvas.js.map +0 -1
  77. package/plugins/helpers/render-components.js.map +0 -1
  78. package/shadcn/components/ui/error-wrapper.js +0 -2
  79. package/shadcn/components/ui/error-wrapper.js.map +0 -1
  80. /package/{GrapesjsCanvas.d.ts → dist/GrapesjsCanvas.d.ts} +0 -0
  81. /package/{constants → dist/constants}/index.d.ts +0 -0
  82. /package/{constants → dist/constants}/index.js +0 -0
  83. /package/{constants → dist/constants}/index.js.map +0 -0
  84. /package/{declaration.d.js → dist/declaration.d.js} +0 -0
  85. /package/{declaration.d.js.map → dist/declaration.d.js.map} +0 -0
  86. /package/{helpers → dist/helpers}/compiled-table.css +0 -0
  87. /package/{helpers → dist/helpers}/css.d.ts +0 -0
  88. /package/{helpers → dist/helpers}/css.js +0 -0
  89. /package/{helpers → dist/helpers}/css.js.map +0 -0
  90. /package/{helpers → dist/helpers}/date-picker.d.ts +0 -0
  91. /package/{helpers → dist/helpers}/date-picker.js +0 -0
  92. /package/{helpers → dist/helpers}/date-picker.js.map +0 -0
  93. /package/{helpers → dist/helpers}/filter-placeholder.d.ts +0 -0
  94. /package/{helpers → dist/helpers}/filter-placeholder.js +0 -0
  95. /package/{helpers → dist/helpers}/filter-placeholder.js.map +0 -0
  96. /package/{helpers → dist/helpers}/index.d.ts +0 -0
  97. /package/{helpers → dist/helpers}/index.js +0 -0
  98. /package/{helpers → dist/helpers}/index.js.map +0 -0
  99. /package/{helpers → dist/helpers}/merge-json.d.ts +0 -0
  100. /package/{helpers → dist/helpers}/merge-json.js +0 -0
  101. /package/{helpers → dist/helpers}/merge-json.js.map +0 -0
  102. /package/{index.d.ts → dist/index.d.ts} +0 -0
  103. /package/{index.js → dist/index.js} +0 -0
  104. /package/{index.js.map → dist/index.js.map} +0 -0
  105. /package/{index.styles.d.ts → dist/index.styles.d.ts} +0 -0
  106. /package/{index.styles.js → dist/index.styles.js} +0 -0
  107. /package/{index.styles.js.map → dist/index.styles.js.map} +0 -0
  108. /package/{plugins → dist/plugins}/grapejs-plugin.d.ts +0 -0
  109. /package/{plugins → dist/plugins}/grapejs-plugin.js +0 -0
  110. /package/{plugins → dist/plugins}/grapejs-plugin.js.map +0 -0
  111. /package/{plugins → dist/plugins}/helpers/custom-modal.d.ts +0 -0
  112. /package/{plugins → dist/plugins}/helpers/custom-modal.js +0 -0
  113. /package/{plugins → dist/plugins}/helpers/custom-modal.js.map +0 -0
  114. /package/{plugins → dist/plugins}/helpers/data-table.d.ts +0 -0
  115. /package/{plugins → dist/plugins}/helpers/data-table.js +0 -0
  116. /package/{plugins → dist/plugins}/helpers/data-table.js.map +0 -0
  117. /package/{plugins → dist/plugins}/helpers/extra.d.ts +0 -0
  118. /package/{plugins → dist/plugins}/helpers/extra.js +0 -0
  119. /package/{plugins → dist/plugins}/helpers/extra.js.map +0 -0
  120. /package/{plugins → dist/plugins}/helpers/query-cache-context.d.ts +0 -0
  121. /package/{plugins → dist/plugins}/helpers/query-cache-context.js +0 -0
  122. /package/{plugins → dist/plugins}/helpers/query-cache-context.js.map +0 -0
  123. /package/{plugins → dist/plugins}/helpers/query-cache-singleton.d.ts +0 -0
  124. /package/{plugins → dist/plugins}/helpers/query-cache-singleton.js +0 -0
  125. /package/{plugins → dist/plugins}/helpers/query-cache-singleton.js.map +0 -0
  126. /package/{plugins → dist/plugins}/helpers/query-cache-utils.d.ts +0 -0
  127. /package/{plugins → dist/plugins}/helpers/query-cache-utils.js +0 -0
  128. /package/{plugins → dist/plugins}/helpers/query-cache-utils.js.map +0 -0
  129. /package/{plugins → dist/plugins}/helpers/query-details-modal.d.ts +0 -0
  130. /package/{plugins → dist/plugins}/helpers/query-details-modal.js +0 -0
  131. /package/{plugins → dist/plugins}/helpers/query-details-modal.js.map +0 -0
  132. /package/{plugins → dist/plugins}/helpers/query-heading-formatter.d.ts +0 -0
  133. /package/{plugins → dist/plugins}/helpers/query-heading-formatter.js +0 -0
  134. /package/{plugins → dist/plugins}/helpers/query-heading-formatter.js.map +0 -0
  135. /package/{plugins → dist/plugins}/helpers/query-loading-modal.d.ts +0 -0
  136. /package/{plugins → dist/plugins}/helpers/query-loading-modal.js +0 -0
  137. /package/{plugins → dist/plugins}/helpers/query-loading-modal.js.map +0 -0
  138. /package/{plugins → dist/plugins}/helpers/render-components.d.ts +0 -0
  139. /package/{plugins → dist/plugins}/helpers/styled-info-button.d.ts +0 -0
  140. /package/{plugins → dist/plugins}/helpers/styled-info-button.js +0 -0
  141. /package/{plugins → dist/plugins}/helpers/styled-info-button.js.map +0 -0
  142. /package/{shadcn → dist/shadcn}/components/icons/AiAvatarIcon.d.ts +0 -0
  143. /package/{shadcn → dist/shadcn}/components/icons/AiAvatarIcon.js +0 -0
  144. /package/{shadcn → dist/shadcn}/components/icons/AiAvatarIcon.js.map +0 -0
  145. /package/{shadcn → dist/shadcn}/components/icons/thinking.gif +0 -0
  146. /package/{shadcn → dist/shadcn}/components/ui/button.d.ts +0 -0
  147. /package/{shadcn → dist/shadcn}/components/ui/button.js +0 -0
  148. /package/{shadcn → dist/shadcn}/components/ui/button.js.map +0 -0
  149. /package/{shadcn → dist/shadcn}/components/ui/card.d.ts +0 -0
  150. /package/{shadcn → dist/shadcn}/components/ui/card.js +0 -0
  151. /package/{shadcn → dist/shadcn}/components/ui/card.js.map +0 -0
  152. /package/{shadcn → dist/shadcn}/components/ui/chart.d.ts +0 -0
  153. /package/{shadcn → dist/shadcn}/components/ui/chart.js +0 -0
  154. /package/{shadcn → dist/shadcn}/components/ui/chart.js.map +0 -0
  155. /package/{shadcn → dist/shadcn}/components/ui/checkbox.d.ts +0 -0
  156. /package/{shadcn → dist/shadcn}/components/ui/checkbox.js +0 -0
  157. /package/{shadcn → dist/shadcn}/components/ui/checkbox.js.map +0 -0
  158. /package/{shadcn → dist/shadcn}/components/ui/component-wrapper.d.ts +0 -0
  159. /package/{shadcn → dist/shadcn}/components/ui/component-wrapper.js +0 -0
  160. /package/{shadcn → dist/shadcn}/components/ui/component-wrapper.js.map +0 -0
  161. /package/{shadcn → dist/shadcn}/components/ui/date-filter.d.ts +0 -0
  162. /package/{shadcn → dist/shadcn}/components/ui/date-filter.js +0 -0
  163. /package/{shadcn → dist/shadcn}/components/ui/date-filter.js.map +0 -0
  164. /package/{shadcn → dist/shadcn}/components/ui/error-container.d.ts +0 -0
  165. /package/{shadcn → dist/shadcn}/components/ui/error-container.js +0 -0
  166. /package/{shadcn → dist/shadcn}/components/ui/error-container.js.map +0 -0
  167. /package/{shadcn → dist/shadcn}/components/ui/error-wrapper.d.ts +0 -0
  168. /package/{shadcn → dist/shadcn}/components/ui/filter.d.ts +0 -0
  169. /package/{shadcn → dist/shadcn}/components/ui/filter.js +0 -0
  170. /package/{shadcn → dist/shadcn}/components/ui/filter.js.map +0 -0
  171. /package/{shadcn → dist/shadcn}/components/ui/hover-card.d.ts +0 -0
  172. /package/{shadcn → dist/shadcn}/components/ui/hover-card.js +0 -0
  173. /package/{shadcn → dist/shadcn}/components/ui/hover-card.js.map +0 -0
  174. /package/{shadcn → dist/shadcn}/components/ui/input.d.ts +0 -0
  175. /package/{shadcn → dist/shadcn}/components/ui/input.js +0 -0
  176. /package/{shadcn → dist/shadcn}/components/ui/input.js.map +0 -0
  177. /package/{shadcn → dist/shadcn}/components/ui/label.d.ts +0 -0
  178. /package/{shadcn → dist/shadcn}/components/ui/label.js +0 -0
  179. /package/{shadcn → dist/shadcn}/components/ui/label.js.map +0 -0
  180. /package/{shadcn → dist/shadcn}/components/ui/pagination.d.ts +0 -0
  181. /package/{shadcn → dist/shadcn}/components/ui/pagination.js +0 -0
  182. /package/{shadcn → dist/shadcn}/components/ui/pagination.js.map +0 -0
  183. /package/{shadcn → dist/shadcn}/components/ui/scroll-area.d.ts +0 -0
  184. /package/{shadcn → dist/shadcn}/components/ui/scroll-area.js +0 -0
  185. /package/{shadcn → dist/shadcn}/components/ui/scroll-area.js.map +0 -0
  186. /package/{shadcn → dist/shadcn}/components/ui/search.d.ts +0 -0
  187. /package/{shadcn → dist/shadcn}/components/ui/search.js +0 -0
  188. /package/{shadcn → dist/shadcn}/components/ui/search.js.map +0 -0
  189. /package/{shadcn → dist/shadcn}/components/ui/separator.d.ts +0 -0
  190. /package/{shadcn → dist/shadcn}/components/ui/separator.js +0 -0
  191. /package/{shadcn → dist/shadcn}/components/ui/separator.js.map +0 -0
  192. /package/{shadcn → dist/shadcn}/components/ui/skeleton.d.ts +0 -0
  193. /package/{shadcn → dist/shadcn}/components/ui/skeleton.js +0 -0
  194. /package/{shadcn → dist/shadcn}/components/ui/skeleton.js.map +0 -0
  195. /package/{shadcn → dist/shadcn}/components/ui/table.d.ts +0 -0
  196. /package/{shadcn → dist/shadcn}/components/ui/table.js +0 -0
  197. /package/{shadcn → dist/shadcn}/components/ui/table.js.map +0 -0
  198. /package/{shadcn → dist/shadcn}/components/ui/tabs.d.ts +0 -0
  199. /package/{shadcn → dist/shadcn}/components/ui/tabs.js +0 -0
  200. /package/{shadcn → dist/shadcn}/components/ui/tabs.js.map +0 -0
  201. /package/{shadcn → dist/shadcn}/components/ui/textarea.d.ts +0 -0
  202. /package/{shadcn → dist/shadcn}/components/ui/textarea.js +0 -0
  203. /package/{shadcn → dist/shadcn}/components/ui/textarea.js.map +0 -0
  204. /package/{shadcn → dist/shadcn}/components/ui/tooltip.d.ts +0 -0
  205. /package/{shadcn → dist/shadcn}/components/ui/tooltip.js +0 -0
  206. /package/{shadcn → dist/shadcn}/components/ui/tooltip.js.map +0 -0
  207. /package/{shadcn → dist/shadcn}/utils.d.ts +0 -0
  208. /package/{shadcn → dist/shadcn}/utils.js +0 -0
  209. /package/{shadcn → dist/shadcn}/utils.js.map +0 -0
  210. /package/{types → dist/types}/grapesjs-tailwind.d.js +0 -0
  211. /package/{types → dist/types}/grapesjs-tailwind.d.js.map +0 -0
  212. /package/{types → dist/types}/images.d.js +0 -0
  213. /package/{types → dist/types}/images.d.js.map +0 -0
@@ -0,0 +1,135 @@
1
+ .aspect-auto {
2
+ aspect-ratio: auto;
3
+ }
4
+
5
+ .h-\[250px\] {
6
+ height: 250px;
7
+ }
8
+
9
+ .w-full {
10
+ width: 100%;
11
+ }
12
+
13
+ .relative {
14
+ position: relative;
15
+ }
16
+
17
+ .sticky {
18
+ position: sticky;
19
+ }
20
+
21
+ .top-0 {
22
+ top: calc(var(--spacing) * 0);
23
+ }
24
+
25
+ .right-0 {
26
+ right: calc(var(--spacing) * 0);
27
+ }
28
+
29
+ .z-2 {
30
+ z-index: 2;
31
+ }
32
+
33
+ .caption-bottom {
34
+ caption-side: bottom;
35
+ }
36
+
37
+ .text-sm {
38
+ font-size: var(--text-sm);
39
+ }
40
+
41
+ .text-xs {
42
+ font-size: var(--text-xs);
43
+ }
44
+
45
+ .text-muted-foreground {
46
+ color: oklch(0.556 0 0);
47
+ }
48
+
49
+ .flex {
50
+ display: flex;
51
+ }
52
+
53
+ .items-center {
54
+ align-items: center;
55
+ }
56
+
57
+ .justify-between {
58
+ justify-content: space-between;
59
+ }
60
+
61
+ .mt-4 {
62
+ margin-top: calc(var(--spacing) * 4);
63
+ }
64
+
65
+ .p-2 {
66
+ padding: calc(var(--spacing) * 2);
67
+ }
68
+
69
+ .px-2 {
70
+ padding-inline: calc(var(--spacing) * 2);
71
+ }
72
+
73
+ .py-1 {
74
+ padding-block: calc(var(--spacing) * 1);
75
+ }
76
+
77
+ .gap-1 {
78
+ gap: calc(var(--spacing) * 1);
79
+ }
80
+
81
+ .gap-2 {
82
+ gap: calc(var(--spacing) * 2);
83
+ }
84
+
85
+ .shrink-0 {
86
+ flex-shrink: 0;
87
+ }
88
+
89
+ .border {
90
+ border-style: var(--tw-border-style);
91
+ border-width: 1px;
92
+ }
93
+
94
+ .border-b {
95
+ border-bottom-style: var(--tw-border-style);
96
+ border-bottom-width: 1px;
97
+ }
98
+
99
+ .rounded {
100
+ border-radius: 0.25rem;
101
+ }
102
+
103
+ .bg-white {
104
+ background-color: rgb(255 255 255);
105
+ }
106
+
107
+ .bg-slate-100 {
108
+ background-color: rgb(241 245 249);
109
+ }
110
+
111
+ .align-middle {
112
+ vertical-align: middle;
113
+ }
114
+
115
+ .whitespace-nowrap {
116
+ white-space: nowrap;
117
+ }
118
+
119
+ .cursor-pointer {
120
+ cursor: pointer;
121
+ }
122
+
123
+ .transition-colors {
124
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
125
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
126
+ transition-duration: 150ms;
127
+ }
128
+
129
+ .hover\:bg-muted\/50 {
130
+ &:hover {
131
+ @media (hover: hover) {
132
+ background-color: color-mix(in oklab, oklch(0.97 0 0) 50%, transparent);
133
+ }
134
+ }
135
+ }
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+
3
+ type AiAvatarIconProps = {
4
+ className?: string;
5
+ width?: number | string;
6
+ height?: number | string;
7
+ }
8
+
9
+ export function AiAvatarIcon({
10
+ className = '',
11
+ width = 13,
12
+ height = 14
13
+ }: AiAvatarIconProps) {
14
+ return (
15
+ <svg
16
+ width={width}
17
+ height={height}
18
+ viewBox="0 0 13 14"
19
+ fill="none"
20
+ xmlns="http://www.w3.org/2000/svg"
21
+ className={className}
22
+ >
23
+ <g id="AI icon">
24
+ <path
25
+ id="Star 1"
26
+ d="M5.85957 1.57888C6.13643 1.07267 6.86346 1.07267 7.14032 1.57888L8.71985 4.46695C8.78683 4.58941 8.88753 4.69011 9.01 4.75709L11.8981 6.33663C12.4043 6.61348 12.4043 7.34051 11.8981 7.61737L9.01 9.19691C8.88753 9.26389 8.78683 9.36458 8.71985 9.48705L7.14032 12.3751C6.86346 12.8813 6.13643 12.8813 5.85957 12.3751L4.28004 9.48705C4.21306 9.36458 4.11236 9.26389 3.9899 9.19691L1.10183 7.61737C0.595615 7.34051 0.595615 6.61348 1.10183 6.33663L3.9899 4.75709C4.11236 4.69011 4.21306 4.58941 4.28004 4.46695L5.85957 1.57888Z"
27
+ fill="#560561"
28
+ />
29
+ <path
30
+ id="Star 2"
31
+ opacity="0.6"
32
+ d="M1.51307 0.650459C1.63952 0.419248 1.97159 0.419248 2.09804 0.650459L2.52483 1.43081C2.55543 1.48675 2.60142 1.53274 2.65735 1.56333L3.4377 1.99012C3.66891 2.11657 3.66891 2.44864 3.4377 2.57509L2.65735 3.00188C2.60142 3.03248 2.55543 3.07847 2.52483 3.1344L2.09805 3.91475C1.97159 4.14596 1.63952 4.14596 1.51307 3.91475L1.08628 3.1344C1.05569 3.07847 1.0097 3.03248 0.953758 3.00188L0.173408 2.57509C-0.0578029 2.44864 -0.0578025 2.11657 0.173408 1.99012L0.953758 1.56333C1.00969 1.53274 1.05569 1.48675 1.08628 1.43081L1.51307 0.650459Z"
33
+ fill="#560561"
34
+ />
35
+ <path
36
+ id="Star 5"
37
+ opacity="0.6"
38
+ d="M11.2322 10.7802C11.3721 10.5244 11.7395 10.5244 11.8794 10.7802L12.156 11.286C12.1898 11.3479 12.2407 11.3988 12.3026 11.4326L12.8084 11.7092C13.0642 11.8491 13.0642 12.2165 12.8084 12.3564L12.3026 12.633C12.2407 12.6669 12.1898 12.7178 12.156 12.7797L11.8794 13.2854C11.7395 13.5412 11.3721 13.5412 11.2322 13.2854L10.9556 12.7797C10.9217 12.7178 10.8708 12.6669 10.8089 12.633L10.3032 12.3564C10.0474 12.2165 10.0474 11.8491 10.3032 11.7092L10.8089 11.4326C10.8708 11.3988 10.9217 11.3479 10.9556 11.286L11.2322 10.7802Z"
39
+ fill="#560561"
40
+ />
41
+ </g>
42
+ </svg>
43
+ );
44
+ }
45
+
46
+ export default AiAvatarIcon;
47
+
@@ -0,0 +1,21 @@
1
+ <svg width="67" height="66" viewBox="0 0 67 66" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g filter="url(#filter0_d_4766_2811)">
3
+ <rect x="16.1667" y="15.5" width="35" height="35" rx="7.5" stroke="#A601FF" shape-rendering="crispEdges"/>
4
+ <path d="M33.0756 28.0171C33.3312 27.5498 34.0023 27.5498 34.2578 28.0171L35.7159 30.683C35.7777 30.7961 35.8706 30.889 35.9837 30.9508L38.6496 32.4089C39.1169 32.6644 39.1169 33.3355 38.6496 33.5911L35.9837 35.0491C35.8706 35.111 35.7777 35.2039 35.7159 35.317L34.2578 37.9829C34.0023 38.4501 33.3312 38.4501 33.0756 37.9829L31.6176 35.317C31.5557 35.2039 31.4628 35.111 31.3497 35.0491L28.6838 33.5911C28.2166 33.3355 28.2166 32.6644 28.6838 32.4089L31.3497 30.9508C31.4628 30.889 31.5557 30.7961 31.6176 30.683L33.0756 28.0171Z" fill="#A601FF"/>
5
+ <path d="M29.0634 27.1601C29.1801 26.9466 29.4866 26.9466 29.6033 27.1601L29.9973 27.8804C30.0255 27.932 30.068 27.9745 30.1196 28.0027L30.84 28.3967C31.0534 28.5134 31.0534 28.8199 30.84 28.9367L30.1196 29.3306C30.068 29.3589 30.0255 29.4013 29.9973 29.4529L29.6033 30.1733C29.4866 30.3867 29.1801 30.3867 29.0634 30.1733L28.6694 29.4529C28.6412 29.4013 28.5987 29.3589 28.5471 29.3306L27.8268 28.9367C27.6133 28.8199 27.6133 28.5134 27.8268 28.3967L28.5471 28.0027C28.5987 27.9745 28.6412 27.932 28.6694 27.8804L29.0634 27.1601Z" fill="#A601FF"/>
6
+ <path d="M38.0346 36.5104C38.1638 36.2743 38.5029 36.2743 38.6321 36.5105L38.8874 36.9773C38.9186 37.0344 38.9656 37.0814 39.0227 37.1126L39.4896 37.368C39.7257 37.4971 39.7257 37.8363 39.4896 37.9654L39.0227 38.2207C38.9656 38.252 38.9186 38.2989 38.8874 38.3561L38.6321 38.8229C38.5029 39.059 38.1638 39.059 38.0346 38.8229L37.7793 38.3561C37.748 38.2989 37.7011 38.252 37.6439 38.2207L37.1771 37.9654C36.941 37.8363 36.941 37.4971 37.1771 37.368L37.6439 37.1126C37.7011 37.0814 37.748 37.0344 37.7793 36.9773L38.0346 36.5104Z" fill="#A601FF"/>
7
+ </g>
8
+ <defs>
9
+ <filter id="filter0_d_4766_2811" x="0.666687" y="0" width="66" height="66" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
10
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
11
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
12
+ <feMorphology radius="5" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_4766_2811"/>
13
+ <feOffset/>
14
+ <feGaussianBlur stdDeviation="5"/>
15
+ <feComposite in2="hardAlpha" operator="out"/>
16
+ <feColorMatrix type="matrix" values="0 0 0 0 0.0317231 0 0 0 0 0.0834676 0 0 0 0 0.370052 0 0 0 0.05 0"/>
17
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4766_2811"/>
18
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4766_2811" result="shape"/>
19
+ </filter>
20
+ </defs>
21
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg width="13" height="14" viewBox="0 0 13 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="AI icon">
3
+ <path id="Star 1" d="M5.85957 1.57888C6.13643 1.07267 6.86346 1.07267 7.14032 1.57888L8.71985 4.46695C8.78683 4.58941 8.88753 4.69011 9.01 4.75709L11.8981 6.33663C12.4043 6.61348 12.4043 7.34051 11.8981 7.61737L9.01 9.19691C8.88753 9.26389 8.78683 9.36458 8.71985 9.48705L7.14032 12.3751C6.86346 12.8813 6.13643 12.8813 5.85957 12.3751L4.28004 9.48705C4.21306 9.36458 4.11236 9.26389 3.9899 9.19691L1.10183 7.61737C0.595615 7.34051 0.595615 6.61348 1.10183 6.33663L3.9899 4.75709C4.11236 4.69011 4.21306 4.58941 4.28004 4.46695L5.85957 1.57888Z" fill="#8943F1"/>
4
+ <path id="Star 2" opacity="0.6" d="M1.51307 0.650459C1.63952 0.419248 1.97159 0.419248 2.09804 0.650459L2.52483 1.43081C2.55543 1.48675 2.60142 1.53274 2.65735 1.56333L3.4377 1.99012C3.66891 2.11657 3.66891 2.44864 3.4377 2.57509L2.65735 3.00188C2.60142 3.03248 2.55543 3.07847 2.52483 3.1344L2.09805 3.91475C1.97159 4.14596 1.63952 4.14596 1.51307 3.91475L1.08628 3.1344C1.05569 3.07847 1.0097 3.03248 0.953758 3.00188L0.173408 2.57509C-0.0578029 2.44864 -0.0578025 2.11657 0.173408 1.99012L0.953758 1.56333C1.00969 1.53274 1.05569 1.48675 1.08628 1.43081L1.51307 0.650459Z" fill="#8943F1"/>
5
+ <path id="Star 5" opacity="0.6" d="M11.2322 10.7802C11.3721 10.5244 11.7395 10.5244 11.8794 10.7802L12.156 11.286C12.1898 11.3479 12.2407 11.3988 12.3026 11.4326L12.8084 11.7092C13.0642 11.8491 13.0642 12.2165 12.8084 12.3564L12.3026 12.633C12.2407 12.6669 12.1898 12.7178 12.156 12.7797L11.8794 13.2854C11.7395 13.5412 11.3721 13.5412 11.2322 13.2854L10.9556 12.7797C10.9217 12.7178 10.8708 12.6669 10.8089 12.633L10.3032 12.3564C10.0474 12.2165 10.0474 11.8491 10.3032 11.7092L10.8089 11.4326C10.8708 11.3988 10.9217 11.3479 10.9556 11.286L11.2322 10.7802Z" fill="#8943F1"/>
6
+ </g>
7
+ </svg>
@@ -0,0 +1,132 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import * as React from 'react';
3
+ import { Slot } from '@radix-ui/react-slot';
4
+ import { cva, type VariantProps } from 'class-variance-authority';
5
+
6
+ import { cn } from '../../utils';
7
+ import { Loader2Icon } from 'lucide-react';
8
+ import { TooltipContent, Tooltip, TooltipTrigger } from './tooltip';
9
+
10
+ const buttonVariants = cva(
11
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
12
+ {
13
+ variants: {
14
+ variant: {
15
+ default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
16
+ destructive:
17
+ 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
18
+ outline:
19
+ 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
20
+ secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
21
+ ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
22
+ link: 'text-primary underline-offset-4 hover:underline',
23
+ },
24
+ size: {
25
+ default: 'h-9 px-4 py-2 has-[>svg]:px-3',
26
+ sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
27
+ lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
28
+ icon: 'size-9',
29
+ },
30
+ },
31
+ defaultVariants: {
32
+ variant: 'default',
33
+ size: 'default',
34
+ },
35
+ },
36
+ );
37
+
38
+ function Button({
39
+ className,
40
+ variant,
41
+ size,
42
+ asChild = false,
43
+ ...props
44
+ }: React.ComponentProps<'button'> &
45
+ VariantProps<typeof buttonVariants> & {
46
+ asChild?: boolean;
47
+ }) {
48
+ const Comp = asChild ? Slot : 'button';
49
+
50
+ return (
51
+ <Comp
52
+ data-slot="button"
53
+ className={cn(buttonVariants({ variant, size, className }))}
54
+ {...props}
55
+ />
56
+ );
57
+ }
58
+
59
+ function TooltipButton(props: any) {
60
+ const { className, isEditable, interact, attributes, variant, size, text, tooltipContent } =
61
+ props;
62
+
63
+ const buttonContent = (
64
+ <Button
65
+ className={className}
66
+ onClick={
67
+ !isEditable
68
+ ? interact
69
+ : () => {
70
+ // no-op
71
+ }
72
+ }
73
+ disabled={attributes.interactionApiInProgress || attributes.disabled}
74
+ variant={variant}
75
+ size={size}
76
+ contentEditable={isEditable}
77
+ asChild={isEditable}
78
+ >
79
+ {attributes.interactionApiInProgress ? (
80
+ <Loader2Icon className="animate-spin" />
81
+ ) : (
82
+ <div data-slot="text">{text}</div>
83
+ )}
84
+ </Button>
85
+ );
86
+
87
+ if (tooltipContent) {
88
+ return (
89
+ <Tooltip>
90
+ <TooltipTrigger asChild>
91
+ <div className="inline-block">{buttonContent}</div>
92
+ </TooltipTrigger>
93
+ <TooltipContent className="max-w-[200px] w-auto whitespace-normal break-all">
94
+ {tooltipContent}
95
+ </TooltipContent>
96
+ </Tooltip>
97
+ );
98
+ }
99
+
100
+ return buttonContent;
101
+ }
102
+
103
+ function TableButton(props: any) {
104
+ const [loading, setLoading] = React.useState(false);
105
+
106
+ async function onClick() {
107
+ setLoading(true);
108
+ await props.onClick();
109
+ setLoading(false);
110
+ }
111
+
112
+ const defaultClasses = 'mr-2';
113
+ const mergedClasses = props.className ? cn(defaultClasses, props.className) : defaultClasses;
114
+
115
+ return (
116
+ <TooltipButton
117
+ className={mergedClasses}
118
+ isEditable={false}
119
+ interact={onClick}
120
+ attributes={{
121
+ interactionApiInProgress: loading,
122
+ isDisabled: props.isDisabled,
123
+ }}
124
+ variant={props.variant}
125
+ size="sm"
126
+ text={props.text}
127
+ tooltipContent={props.tooltipContent}
128
+ />
129
+ );
130
+ }
131
+
132
+ export { Button, buttonVariants, TooltipButton, TableButton };
@@ -0,0 +1,92 @@
1
+ import * as React from 'react';
2
+
3
+ import { cn } from '../../utils';
4
+
5
+ type CardProps = React.ComponentProps<'div'> & {
6
+ isEditable?: boolean;
7
+ };
8
+
9
+ function Card({ className, isEditable, ...props }: CardProps) {
10
+ return (
11
+ <div
12
+ data-slot="card"
13
+ className={cn(
14
+ 'bg-white text-card-foreground flex flex-col gap-4 rounded-lg border py-3 p-3',
15
+ className,
16
+ )}
17
+ contentEditable={isEditable}
18
+ {...props}
19
+ />
20
+ );
21
+ }
22
+
23
+ function CardHeader({ className, isEditable, ...props }: CardProps) {
24
+ return (
25
+ <div
26
+ data-slot="card-header"
27
+ className={cn(
28
+ '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
29
+ className,
30
+ )}
31
+ contentEditable={isEditable}
32
+ {...props}
33
+ />
34
+ );
35
+ }
36
+
37
+ function CardTitle({ className, isEditable, ...props }: CardProps) {
38
+ return (
39
+ <div
40
+ data-slot="card-title"
41
+ className={cn('leading-none font-semibold', className)}
42
+ contentEditable={isEditable}
43
+ {...props}
44
+ />
45
+ );
46
+ }
47
+
48
+ function CardDescription({ className, isEditable, ...props }: CardProps) {
49
+ return (
50
+ <div
51
+ data-slot="card-description"
52
+ className={cn('text-muted-foreground text-sm text-gray-500', className)}
53
+ contentEditable={isEditable}
54
+ {...props}
55
+ />
56
+ );
57
+ }
58
+
59
+ function CardAction({ className, isEditable, ...props }: CardProps) {
60
+ return (
61
+ <div
62
+ data-slot="card-action"
63
+ className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
64
+ contentEditable={isEditable}
65
+ {...props}
66
+ />
67
+ );
68
+ }
69
+
70
+ function CardContent({ className, isEditable, ...props }: CardProps) {
71
+ return (
72
+ <div
73
+ data-slot="card-content"
74
+ className={cn('px-3', className)}
75
+ contentEditable={isEditable}
76
+ {...props}
77
+ />
78
+ );
79
+ }
80
+
81
+ function CardFooter({ className, isEditable, ...props }: CardProps) {
82
+ return (
83
+ <div
84
+ data-slot="card-footer"
85
+ className={cn('flex gap-2 ml-2.5 px-3 py-1 text-sm rounded-xl w-fit', className)}
86
+ contentEditable={isEditable}
87
+ {...props}
88
+ />
89
+ );
90
+ }
91
+
92
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };