@vibes.diy/use-vibes-base 2.0.1 → 2.0.6

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 (84) hide show
  1. package/README.md +44 -44
  2. package/hooks/vibes-gen/IframeVibesComponent.js +1 -1
  3. package/hooks/vibes-gen/IframeVibesComponent.js.map +1 -1
  4. package/hooks/vibes-gen/use-vibes.js +6 -12
  5. package/hooks/vibes-gen/use-vibes.js.map +1 -1
  6. package/index.d.ts +2 -13
  7. package/index.js +0 -10
  8. package/index.js.map +1 -1
  9. package/package.json +13 -11
  10. package/components/ControlsBar.d.ts +0 -20
  11. package/components/ControlsBar.js +0 -104
  12. package/components/ControlsBar.js.map +0 -1
  13. package/components/ImgGen.d.ts +0 -23
  14. package/components/ImgGen.js +0 -257
  15. package/components/ImgGen.js.map +0 -1
  16. package/components/ImgGenUtils/AsyncImg.d.ts +0 -7
  17. package/components/ImgGenUtils/AsyncImg.js +0 -41
  18. package/components/ImgGenUtils/AsyncImg.js.map +0 -1
  19. package/components/ImgGenUtils/ImgGenDisplay.d.ts +0 -3
  20. package/components/ImgGenUtils/ImgGenDisplay.js +0 -230
  21. package/components/ImgGenUtils/ImgGenDisplay.js.map +0 -1
  22. package/components/ImgGenUtils/ImgGenDisplayPlaceholder.d.ts +0 -3
  23. package/components/ImgGenUtils/ImgGenDisplayPlaceholder.js +0 -97
  24. package/components/ImgGenUtils/ImgGenDisplayPlaceholder.js.map +0 -1
  25. package/components/ImgGenUtils/ImgGenDisplayUtils.d.ts +0 -27
  26. package/components/ImgGenUtils/ImgGenDisplayUtils.js +0 -90
  27. package/components/ImgGenUtils/ImgGenDisplayUtils.js.map +0 -1
  28. package/components/ImgGenUtils/ImgGenError.d.ts +0 -3
  29. package/components/ImgGenUtils/ImgGenError.js +0 -9
  30. package/components/ImgGenUtils/ImgGenError.js.map +0 -1
  31. package/components/ImgGenUtils/ImgGenFileDrop.d.ts +0 -11
  32. package/components/ImgGenUtils/ImgGenFileDrop.js +0 -56
  33. package/components/ImgGenUtils/ImgGenFileDrop.js.map +0 -1
  34. package/components/ImgGenUtils/ImgGenModal.d.ts +0 -25
  35. package/components/ImgGenUtils/ImgGenModal.js +0 -67
  36. package/components/ImgGenUtils/ImgGenModal.js.map +0 -1
  37. package/components/ImgGenUtils/ImgGenModeUtils.d.ts +0 -9
  38. package/components/ImgGenUtils/ImgGenModeUtils.js +0 -58
  39. package/components/ImgGenUtils/ImgGenModeUtils.js.map +0 -1
  40. package/components/ImgGenUtils/ImgGenPromptWaiting.d.ts +0 -11
  41. package/components/ImgGenUtils/ImgGenPromptWaiting.js +0 -40
  42. package/components/ImgGenUtils/ImgGenPromptWaiting.js.map +0 -1
  43. package/components/ImgGenUtils/ImgGenUploadWaiting.d.ts +0 -16
  44. package/components/ImgGenUtils/ImgGenUploadWaiting.js +0 -154
  45. package/components/ImgGenUtils/ImgGenUploadWaiting.js.map +0 -1
  46. package/components/ImgGenUtils/index.d.ts +0 -6
  47. package/components/ImgGenUtils/index.js +0 -7
  48. package/components/ImgGenUtils/index.js.map +0 -1
  49. package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.d.ts +0 -9
  50. package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.js +0 -31
  51. package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.js.map +0 -1
  52. package/components/ImgGenUtils/overlays/ImageOverlay.d.ts +0 -22
  53. package/components/ImgGenUtils/overlays/ImageOverlay.js +0 -11
  54. package/components/ImgGenUtils/overlays/ImageOverlay.js.map +0 -1
  55. package/components/ImgGenUtils/types.d.ts +0 -29
  56. package/components/ImgGenUtils/types.js +0 -2
  57. package/components/ImgGenUtils/types.js.map +0 -1
  58. package/components/ImgGenUtils.d.ts +0 -2
  59. package/components/ImgGenUtils.js +0 -3
  60. package/components/ImgGenUtils.js.map +0 -1
  61. package/components/PromptBar.d.ts +0 -11
  62. package/components/PromptBar.js +0 -24
  63. package/components/PromptBar.js.map +0 -1
  64. package/hooks/image-gen/image-generator.d.ts +0 -11
  65. package/hooks/image-gen/image-generator.js +0 -146
  66. package/hooks/image-gen/image-generator.js.map +0 -1
  67. package/hooks/image-gen/index.d.ts +0 -7
  68. package/hooks/image-gen/index.js +0 -6
  69. package/hooks/image-gen/index.js.map +0 -1
  70. package/hooks/image-gen/use-image-gen.d.ts +0 -2
  71. package/hooks/image-gen/use-image-gen.js +0 -537
  72. package/hooks/image-gen/use-image-gen.js.map +0 -1
  73. package/hooks/image-gen/utils.d.ts +0 -19
  74. package/hooks/image-gen/utils.js +0 -150
  75. package/hooks/image-gen/utils.js.map +0 -1
  76. package/utils/debug.d.ts +0 -2
  77. package/utils/debug.js +0 -8
  78. package/utils/debug.js.map +0 -1
  79. package/utils/style-utils.d.ts +0 -4
  80. package/utils/style-utils.js +0 -15
  81. package/utils/style-utils.js.map +0 -1
  82. package/utils/styles.d.ts +0 -325
  83. package/utils/styles.js +0 -328
  84. package/utils/styles.js.map +0 -1
@@ -1,150 +0,0 @@
1
- export const MODULE_STATE = {
2
- pendingImageGenCalls: new Map(),
3
- pendingPrompts: new Set(),
4
- processingRequests: new Set(),
5
- requestTimestamps: new Map(),
6
- requestCounter: 0,
7
- createdDocuments: new Map(),
8
- pendingDocumentCreations: new Map(),
9
- };
10
- export function cleanupRequestKey(key) {
11
- MODULE_STATE.pendingImageGenCalls.delete(key);
12
- MODULE_STATE.processingRequests.delete(key);
13
- MODULE_STATE.pendingPrompts.delete(key);
14
- MODULE_STATE.pendingDocumentCreations.delete(key);
15
- MODULE_STATE.requestTimestamps.delete(key);
16
- }
17
- export function hashInput(prompt, options) {
18
- const inputString = JSON.stringify({
19
- prompt,
20
- options,
21
- });
22
- let hash = 2166136261;
23
- for (let i = 0; i < inputString.length; i++) {
24
- hash ^= inputString.charCodeAt(i);
25
- hash = Math.imul(hash, 16777619);
26
- }
27
- const hashHex = (hash >>> 0).toString(16).padStart(8, "0");
28
- const requestId = hashHex.slice(0, 12);
29
- return `${requestId}-${Date.now().toString(36)}`;
30
- }
31
- export function base64ToFile(base64Data, filename) {
32
- const byteString = atob(base64Data);
33
- const ab = new ArrayBuffer(byteString.length);
34
- const ia = new Uint8Array(ab);
35
- for (let i = 0; i < byteString.length; i++) {
36
- ia[i] = byteString.charCodeAt(i);
37
- }
38
- const blob = new Blob([ab], { type: "image/png" });
39
- return new File([blob], filename, { type: "image/png" });
40
- }
41
- export function generateVersionId(versionNumber) {
42
- return `v${versionNumber}`;
43
- }
44
- export function getVersionsFromDocument(document) {
45
- if (document?.versions && document.versions.length > 0) {
46
- return {
47
- versions: document.versions,
48
- currentVersion: document.currentVersion ?? document.versions.length,
49
- };
50
- }
51
- if (document?._files?.image) {
52
- return {
53
- versions: [{ id: "v1", created: document.created || Date.now() }],
54
- currentVersion: 1,
55
- };
56
- }
57
- return { versions: [], currentVersion: 0 };
58
- }
59
- export function generatePromptKey(promptNumber) {
60
- return `p${promptNumber}`;
61
- }
62
- export function getPromptsFromDocument(document) {
63
- if (document?.prompts && document?.currentPromptKey) {
64
- return {
65
- prompts: document.prompts,
66
- currentPromptKey: document.currentPromptKey,
67
- };
68
- }
69
- if (document?.prompt) {
70
- return {
71
- prompts: {
72
- p1: { text: document.prompt, created: document.created || Date.now() },
73
- },
74
- currentPromptKey: "p1",
75
- };
76
- }
77
- return { prompts: {}, currentPromptKey: "" };
78
- }
79
- export function addNewVersion(document, newImageFile, newPrompt) {
80
- const { versions } = getVersionsFromDocument(document);
81
- const versionCount = versions.length + 1;
82
- const newVersionId = generateVersionId(versionCount);
83
- const { prompts, currentPromptKey } = getPromptsFromDocument(document);
84
- const updatedPrompts = { ...prompts };
85
- let updatedCurrentPromptKey = currentPromptKey;
86
- if (newPrompt && (!currentPromptKey || newPrompt !== prompts[currentPromptKey]?.text)) {
87
- const promptCount = Object.keys(updatedPrompts).length + 1;
88
- updatedCurrentPromptKey = generatePromptKey(promptCount);
89
- updatedPrompts[updatedCurrentPromptKey] = {
90
- text: newPrompt,
91
- created: Date.now(),
92
- };
93
- }
94
- else if (!updatedCurrentPromptKey && document.prompt) {
95
- updatedCurrentPromptKey = "p1";
96
- updatedPrompts["p1"] = {
97
- text: document.prompt,
98
- created: document.created || Date.now(),
99
- };
100
- }
101
- const updatedFiles = { ...(document._files || {}) };
102
- updatedFiles[newVersionId] = newImageFile;
103
- if (versionCount === 1 && document._files?.image) {
104
- updatedFiles["v1"] = document._files.image;
105
- delete updatedFiles.image;
106
- }
107
- return {
108
- ...document,
109
- currentVersion: versionCount - 1,
110
- versions: [
111
- ...versions,
112
- {
113
- id: newVersionId,
114
- created: Date.now(),
115
- promptKey: updatedCurrentPromptKey,
116
- },
117
- ],
118
- prompts: updatedPrompts,
119
- currentPromptKey: updatedCurrentPromptKey,
120
- _files: updatedFiles,
121
- };
122
- }
123
- export function getRelevantOptions(options) {
124
- if (!options)
125
- return {};
126
- const relevantOptions = {};
127
- if (options.size)
128
- relevantOptions.size = options.size;
129
- if (options.quality)
130
- relevantOptions.quality = options.quality;
131
- if (options.model)
132
- relevantOptions.model = options.model;
133
- if (options.style)
134
- relevantOptions.style = options.style;
135
- return relevantOptions;
136
- }
137
- export function generateSafeFilename(promptText) {
138
- const maxPromptChars = 40;
139
- const cleanedPrompt = promptText
140
- .toLowerCase()
141
- .replace(/[^a-z0-9\s-]/g, "")
142
- .replace(/\s+/g, "-")
143
- .substring(0, maxPromptChars)
144
- .replace(/-+$/g, "");
145
- const now = new Date();
146
- const datePart = `${now.getFullYear()}${String(now.getMonth() + 1).padStart(2, "0")}${String(now.getDate()).padStart(2, "0")}`;
147
- const timePart = `${String(now.getHours()).padStart(2, "0")}${String(now.getMinutes()).padStart(2, "0")}`;
148
- return `${cleanedPrompt}-${datePart}-${timePart}.png`;
149
- }
150
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../jsr/hooks/image-gen/utils.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,YAAY,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C,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAC/H,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAG1G,OAAO,GAAG,aAAa,IAAI,QAAQ,IAAI,QAAQ,MAAM,CAAC;AACxD,CAAC"}
package/utils/debug.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const isDebug: () => boolean;
2
- export declare function logDebug(...args: unknown[]): void;
package/utils/debug.js DELETED
@@ -1,8 +0,0 @@
1
- export const isDebug = () => Boolean(import.meta.env?.DEV) &&
2
- (typeof window === "undefined" || localStorage.getItem("debugDelete") === "1");
3
- export function logDebug(...args) {
4
- if (isDebug()) {
5
- console.log(...args);
6
- }
7
- }
8
- //# sourceMappingURL=debug.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../jsr/utils/debug.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,GAAY,EAAE,CACnC,OAAO,CAAE,OAAO,IAA+C,CAAC,GAAG,EAAE,GAAG,CAAC;IACzE,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC;AAEjF,MAAM,UAAU,QAAQ,CAAC,GAAG,IAAe;IACzC,IAAI,OAAO,EAAE,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { ImgGenClasses } from "@vibes.diy/use-vibes-types";
2
- export type { ImgGenClasses };
3
- export declare function combineClasses(...classes: (string | boolean | null | undefined)[]): string;
4
- export declare const defaultClasses: Partial<ImgGenClasses>;
@@ -1,15 +0,0 @@
1
- export function combineClasses(...classes) {
2
- const validClasses = classes.filter(Boolean);
3
- const allClasses = [...validClasses];
4
- validClasses.forEach((cls) => {
5
- if (cls.startsWith("imggen-")) {
6
- const legacyClass = cls.replace("imggen-", "img-gen-");
7
- if (!allClasses.includes(legacyClass)) {
8
- allClasses.push(legacyClass);
9
- }
10
- }
11
- });
12
- return allClasses.join(" ");
13
- }
14
- export const defaultClasses = {};
15
- //# sourceMappingURL=style-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"style-utils.js","sourceRoot":"","sources":["../../jsr/utils/style-utils.ts"],"names":[],"mappings":"AAwBA,MAAM,UAAU,cAAc,CAAC,GAAG,OAAgD;IAEhF,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAa,CAAC;IAGzD,MAAM,UAAU,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;IAGrC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC3B,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAE9B,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAEvD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;gBACtC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC;AAKD,MAAM,CAAC,MAAM,cAAc,GAA2B,EAAE,CAAC"}
package/utils/styles.d.ts DELETED
@@ -1,325 +0,0 @@
1
- export declare const imgGenTheme: {
2
- readonly colors: {
3
- readonly text: "#333";
4
- readonly background: "#333333";
5
- readonly overlayBg: "rgba(255, 255, 255, 0.5)";
6
- readonly accent: "#0066cc";
7
- readonly flash: "#fe0";
8
- readonly errorBg: "rgba(0, 0, 0, 0.7)";
9
- readonly errorBorder: "#ff6666";
10
- readonly errorText: "#ff6666";
11
- readonly errorTextBody: "#ffffff";
12
- readonly buttonBg: "rgba(255, 255, 255, 0.7)";
13
- readonly deleteHover: "#ff3333";
14
- readonly inputBorder: "light-dark(#ccc, #555)";
15
- readonly inputBg: "light-dark(#ffffff, #2a2a2a)";
16
- readonly inputText: "light-dark(#333, #e0e0e0)";
17
- readonly dropZoneBorder: "light-dark(#ccc, #555)";
18
- readonly dropZoneBg: "light-dark(#fafafa, #2a2a2a)";
19
- readonly dropZoneActiveBg: "light-dark(#f0f8ff, #1a3a4a)";
20
- readonly mutedText: "light-dark(#666, #aaa)";
21
- readonly lightBg: "light-dark(#f0f0f0, #404040)";
22
- readonly thumbnailBorder: "light-dark(#ddd, #555)";
23
- readonly titleText: "light-dark(#333, #e0e0e0)";
24
- };
25
- readonly dimensions: {
26
- readonly borderRadius: "8px";
27
- readonly padding: "8px";
28
- readonly buttonSize: "28px";
29
- readonly progressHeight: "8px";
30
- };
31
- readonly typography: {
32
- readonly fontSize: "14px";
33
- readonly fontWeight: "bold";
34
- readonly lineHeight: "1.5";
35
- };
36
- readonly effects: {
37
- readonly blurRadius: "4px";
38
- readonly transitionSpeed: "0.2s";
39
- readonly shadow: "0 4px 8px rgba(0, 0, 0, 0.2)";
40
- };
41
- };
42
- export declare const imgGenStyles: {
43
- readonly root: {
44
- readonly position: "relative";
45
- readonly maxWidth: "100%";
46
- readonly overflow: "hidden";
47
- };
48
- readonly container: {
49
- readonly position: "relative";
50
- readonly width: "100%";
51
- readonly height: "100%";
52
- };
53
- readonly imageContainer: {
54
- readonly position: "relative";
55
- readonly width: "100%";
56
- readonly overflow: "hidden";
57
- };
58
- readonly image: {
59
- readonly width: "100%";
60
- readonly height: "auto";
61
- readonly display: "block";
62
- };
63
- readonly overlay: {
64
- readonly position: "absolute";
65
- readonly bottom: 0;
66
- readonly left: 0;
67
- readonly right: 0;
68
- readonly padding: "8px";
69
- readonly backgroundColor: "rgba(255, 255, 255, 0.5)";
70
- readonly backdropFilter: "blur(4px)";
71
- readonly WebkitBackdropFilter: "blur(4px)";
72
- readonly transition: "opacity 0.2s ease";
73
- readonly zIndex: 10;
74
- readonly display: "flex";
75
- readonly flexDirection: "column";
76
- };
77
- readonly topLine: {
78
- readonly display: "flex";
79
- readonly alignItems: "center";
80
- readonly justifyContent: "space-between";
81
- readonly width: "100%";
82
- };
83
- readonly prompt: {
84
- readonly width: "100%";
85
- readonly padding: "4px";
86
- readonly marginBottom: "8px";
87
- };
88
- readonly promptText: {
89
- readonly color: "#333";
90
- readonly width: "100%";
91
- readonly textAlign: "center";
92
- readonly fontWeight: "bold";
93
- readonly padding: "2px";
94
- readonly cursor: "pointer";
95
- };
96
- readonly controls: {
97
- readonly display: "flex";
98
- readonly alignItems: "center";
99
- readonly justifyContent: "space-between";
100
- readonly width: "100%";
101
- readonly paddingTop: "2px";
102
- };
103
- readonly controlGroup: {
104
- readonly display: "flex";
105
- readonly gap: "6px";
106
- readonly alignItems: "center";
107
- };
108
- readonly button: {
109
- readonly background: "rgba(255, 255, 255, 0.7)";
110
- readonly borderRadius: "50%";
111
- readonly width: "28px";
112
- readonly height: "28px";
113
- readonly display: "flex";
114
- readonly alignItems: "center";
115
- readonly justifyContent: "center";
116
- readonly border: "none";
117
- readonly cursor: "pointer";
118
- readonly opacity: 0.5;
119
- readonly transition: "opacity 0.2s ease";
120
- readonly padding: 0;
121
- readonly fontSize: "14px";
122
- readonly color: "#333";
123
- };
124
- readonly progressContainer: {
125
- readonly position: "absolute";
126
- readonly top: 0;
127
- readonly left: 0;
128
- readonly right: 0;
129
- readonly zIndex: 50;
130
- };
131
- readonly progress: {
132
- readonly position: "absolute";
133
- readonly top: 0;
134
- readonly left: 0;
135
- readonly height: "8px";
136
- readonly backgroundColor: "#0066cc";
137
- readonly transition: "width 0.3s ease-in-out";
138
- readonly zIndex: 11;
139
- };
140
- readonly placeholder: {
141
- readonly width: "100%";
142
- readonly aspectRatio: "1 / 1";
143
- readonly backgroundColor: "#333333";
144
- readonly position: "relative";
145
- readonly overflow: "hidden";
146
- readonly display: "flex";
147
- readonly alignItems: "center";
148
- readonly justifyContent: "center";
149
- readonly boxSizing: "border-box";
150
- };
151
- readonly statusText: {
152
- readonly width: "100%";
153
- readonly textAlign: "center";
154
- readonly fontSize: "14px";
155
- readonly color: "#333";
156
- readonly opacity: 0.7;
157
- readonly padding: "8px 0";
158
- };
159
- readonly errorContainer: {
160
- readonly backgroundColor: "#222";
161
- readonly aspectRatio: "1 / 1";
162
- readonly display: "flex";
163
- readonly flexDirection: "column";
164
- readonly justifyContent: "center";
165
- readonly alignItems: "center";
166
- readonly padding: "1rem";
167
- readonly width: "100%";
168
- readonly borderRadius: "8px";
169
- readonly overflow: "hidden";
170
- };
171
- readonly error: {
172
- readonly backgroundColor: "#000";
173
- readonly color: "#ff6666";
174
- readonly padding: "1.5rem";
175
- readonly borderRadius: "8px";
176
- readonly border: "1px solid #ff6666";
177
- readonly boxShadow: "0 4px 8px rgba(0, 0, 0, 0.2)";
178
- readonly maxWidth: "80%";
179
- readonly display: "flex";
180
- readonly flexDirection: "column";
181
- readonly justifyContent: "center";
182
- readonly alignItems: "center";
183
- readonly textAlign: "center";
184
- };
185
- readonly errorTitle: {
186
- readonly color: "#ff6666";
187
- readonly marginTop: 0;
188
- readonly fontWeight: "bold";
189
- readonly fontSize: "18px";
190
- readonly marginBottom: "12px";
191
- readonly textAlign: "center";
192
- };
193
- readonly errorMessage: {
194
- readonly whiteSpace: "pre-wrap";
195
- readonly color: "#ffffff";
196
- readonly fontSize: "14px";
197
- readonly lineHeight: "1.5";
198
- readonly textAlign: "left";
199
- readonly fontFamily: "monospace, sans-serif";
200
- readonly marginBottom: 0;
201
- };
202
- readonly promptInputEditMode: {
203
- readonly border: "2px solid #0066cc";
204
- readonly padding: "6px 10px";
205
- readonly borderRadius: "6px";
206
- };
207
- readonly uploadWaiting: {
208
- readonly display: "flex";
209
- readonly flexDirection: "column";
210
- readonly gap: "1rem";
211
- readonly padding: "1rem";
212
- readonly alignItems: "center";
213
- readonly textAlign: "center";
214
- readonly backgroundColor: "light-dark(#ffffff, #2a2a2a)";
215
- readonly borderRadius: "8px";
216
- readonly border: "1px solid light-dark(#ccc, #555)";
217
- };
218
- readonly promptForm: {
219
- readonly display: "flex";
220
- readonly gap: "0.5rem";
221
- readonly width: "100%";
222
- readonly maxWidth: "600px";
223
- readonly flexDirection: "column";
224
- };
225
- readonly promptInput: {
226
- readonly width: "100%";
227
- readonly padding: "0.8rem";
228
- readonly fontSize: "1rem";
229
- readonly border: "1px solid light-dark(#ccc, #555)";
230
- readonly borderRadius: "4px";
231
- readonly boxSizing: "border-box";
232
- readonly backgroundColor: "light-dark(#ffffff, #2a2a2a)";
233
- readonly color: "light-dark(#333, #e0e0e0)";
234
- };
235
- readonly promptSubmit: {
236
- readonly padding: "0.8rem";
237
- readonly fontSize: "1rem";
238
- readonly backgroundColor: "#0066cc";
239
- readonly color: "white";
240
- readonly border: "none";
241
- readonly borderRadius: "4px";
242
- readonly cursor: "pointer";
243
- readonly transition: "background-color 0.3s";
244
- };
245
- readonly fileDrop: {
246
- readonly border: "2px dashed light-dark(#ccc, #555)";
247
- readonly borderRadius: "8px";
248
- readonly padding: "2rem";
249
- readonly textAlign: "center";
250
- readonly cursor: "pointer";
251
- readonly transition: "border-color 0.3s, background-color 0.3s";
252
- readonly backgroundColor: "light-dark(#fafafa, #2a2a2a)";
253
- readonly marginTop: "1rem";
254
- };
255
- readonly fileDropActive: {
256
- readonly borderColor: "#0066cc";
257
- readonly backgroundColor: "light-dark(#f0f8ff, #1a3a4a)";
258
- };
259
- readonly fileDropDisabled: {
260
- readonly opacity: 0.5;
261
- readonly cursor: "not-allowed";
262
- };
263
- readonly fileDropMessage: {
264
- readonly color: "light-dark(#666, #aaa)";
265
- readonly fontSize: "1rem";
266
- readonly fontWeight: "normal";
267
- };
268
- readonly uploadedPreviews: {
269
- readonly width: "100%";
270
- readonly marginTop: "1rem";
271
- };
272
- readonly uploadCount: {
273
- readonly fontSize: "0.9rem";
274
- readonly color: "light-dark(#666, #aaa)";
275
- readonly marginBottom: "0.5rem";
276
- readonly fontWeight: "bold";
277
- };
278
- readonly thumbnails: {
279
- readonly display: "grid";
280
- readonly gridTemplateColumns: "repeat(auto-fit, minmax(80px, 1fr))";
281
- readonly gap: "0.5rem";
282
- readonly maxWidth: "400px";
283
- readonly margin: "0 auto";
284
- };
285
- readonly thumbnail: {
286
- readonly aspectRatio: "1 / 1";
287
- readonly overflow: "hidden";
288
- readonly borderRadius: "4px";
289
- readonly border: "1px solid light-dark(#ddd, #555)";
290
- };
291
- readonly thumbnailImg: {
292
- readonly width: "100%";
293
- readonly height: "100%";
294
- readonly objectFit: "cover";
295
- };
296
- readonly moreCount: {
297
- readonly display: "flex";
298
- readonly alignItems: "center";
299
- readonly justifyContent: "center";
300
- readonly backgroundColor: "light-dark(#f0f0f0, #404040)";
301
- readonly color: "light-dark(#666, #aaa)";
302
- readonly fontSize: "0.8rem";
303
- readonly fontWeight: "bold";
304
- };
305
- readonly truncate: {
306
- readonly whiteSpace: "nowrap";
307
- readonly overflow: "hidden";
308
- readonly textOverflow: "ellipsis";
309
- };
310
- };
311
- export declare function createStyledVariant(baseStyle: Record<string, unknown>, variants?: Record<string, unknown>): Record<string, unknown>;
312
- export declare const styleUtils: {
313
- hover: (styles: Record<string, unknown>) => {
314
- "&:hover": Record<string, unknown>;
315
- };
316
- disabled: (styles: Record<string, unknown>) => {
317
- "&:disabled": Record<string, unknown>;
318
- };
319
- mediaQuery: (query: string, styles: Record<string, unknown>) => {
320
- [x: string]: Record<string, unknown>;
321
- };
322
- transition: (properties: string[], duration?: string) => {
323
- transition: string;
324
- };
325
- };