@vibes.diy/use-vibes-base 0.12.14 → 0.12.15-dev02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AuthWall/AuthWall.d.ts +8 -0
- package/components/AuthWall/AuthWall.js +48 -0
- package/components/AuthWall/AuthWall.js.map +1 -0
- package/components/AuthWall/AuthWall.styles.d.ts +6 -0
- package/components/AuthWall/AuthWall.styles.js +50 -0
- package/components/AuthWall/AuthWall.styles.js.map +1 -0
- package/components/ControlsBar.d.ts +1 -1
- package/components/ControlsBar.js +4 -4
- package/components/ControlsBar.js.map +1 -1
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.d.ts +6 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.js +52 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.js.map +1 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.styles.d.ts +30 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.styles.js +72 -0
- package/components/HiddenMenuWrapper/HiddenMenuWrapper.styles.js.map +1 -0
- package/components/ImgGen.d.ts +1 -2
- package/components/ImgGen.js +6 -4
- package/components/ImgGen.js.map +1 -1
- package/components/ImgGenUtils/ImgGenDisplayPlaceholder.js +1 -1
- package/components/ImgGenUtils/ImgGenDisplayPlaceholder.js.map +1 -1
- package/components/ImgGenUtils/ImgGenDisplayUtils.d.ts +2 -2
- package/components/ImgGenUtils/ImgGenModeUtils.d.ts +1 -1
- package/components/ImgGenUtils/ImgGenUploadWaiting.d.ts +1 -1
- package/components/ImgGenUtils/ImgGenUploadWaiting.js +2 -2
- package/components/ImgGenUtils/ImgGenUploadWaiting.js.map +1 -1
- package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.js +1 -1
- package/components/ImgGenUtils/overlays/DeleteConfirmationOverlay.js.map +1 -1
- package/components/ImgGenUtils/types.d.ts +1 -1
- package/components/VibeControl.d.ts +13 -0
- package/components/VibeControl.js +59 -0
- package/components/VibeControl.js.map +1 -0
- package/components/VibesButton/VibesButton.d.ts +10 -0
- package/components/VibesButton/VibesButton.js +20 -0
- package/components/VibesButton/VibesButton.js.map +1 -0
- package/components/VibesButton/VibesButton.styles.d.ts +6 -0
- package/components/VibesButton/VibesButton.styles.js +35 -0
- package/components/VibesButton/VibesButton.styles.js.map +1 -0
- package/components/VibesSwitch/VibesSwitch.d.ts +6 -0
- package/components/VibesSwitch/VibesSwitch.js +42 -0
- package/components/VibesSwitch/VibesSwitch.js.map +1 -0
- package/components/VibesSwitch/VibesSwitch.styles.d.ts +4 -0
- package/components/VibesSwitch/VibesSwitch.styles.js +5 -0
- package/components/VibesSwitch/VibesSwitch.styles.js.map +1 -0
- package/hooks/image-gen/image-generator.d.ts +1 -1
- package/hooks/image-gen/index.d.ts +1 -1
- package/hooks/image-gen/index.js.map +1 -1
- package/hooks/image-gen/use-image-gen.d.ts +2 -4
- package/hooks/image-gen/use-image-gen.js.map +1 -1
- package/hooks/image-gen/utils.d.ts +1 -1
- package/hooks/image-gen/utils.js.map +1 -1
- package/hooks/vibes-gen/IframeVibesComponent.d.ts +1 -0
- package/hooks/vibes-gen/IframeVibesComponent.js +8 -3
- package/hooks/vibes-gen/IframeVibesComponent.js.map +1 -1
- package/hooks/vibes-gen/index.d.ts +1 -1
- package/hooks/vibes-gen/use-vibes.d.ts +1 -1
- package/hooks/vibes-gen/use-vibes.js +4 -4
- package/hooks/vibes-gen/use-vibes.js.map +1 -1
- package/index.d.ts +22 -4
- package/index.js +12 -2
- package/index.js.map +1 -1
- package/package.json +16 -6
- package/stories/VibeControl.stories.d.ts +13 -0
- package/stories/VibeControl.stories.js +155 -0
- package/stories/VibeControl.stories.js.map +1 -0
- package/stories/VibeControlMount.stories.d.ts +14 -0
- package/stories/VibeControlMount.stories.js +182 -0
- package/stories/VibeControlMount.stories.js.map +1 -0
- package/tsconfig.json +0 -4
- package/utils/style-utils.d.ts +2 -15
- package/utils/style-utils.js.map +1 -1
- package/utils/vibe-control-styles.d.ts +148 -0
- package/utils/vibe-control-styles.js +170 -0
- package/utils/vibe-control-styles.js.map +1 -0
- package/vibe-auth-wall.d.ts +14 -0
- package/vibe-auth-wall.js +79 -0
- package/vibe-auth-wall.js.map +1 -0
- package/vibe-control-mount.d.ts +14 -0
- package/vibe-control-mount.js +75 -0
- package/vibe-control-mount.js.map +1 -0
- package/vibe-hidden-menu-mount.d.ts +18 -0
- package/vibe-hidden-menu-mount.js +73 -0
- package/vibe-hidden-menu-mount.js.map +1 -0
- package/hooks/image-gen/types.d.ts +0 -66
- package/hooks/image-gen/types.js +0 -2
- package/hooks/image-gen/types.js.map +0 -1
- package/hooks/vibes-gen/types.d.ts +0 -42
- package/hooks/vibes-gen/types.js +0 -2
- package/hooks/vibes-gen/types.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ManualRedirectStrategy } from './ManualRedirectStrategy.js';
|
|
|
4
4
|
export { fireproof, ImgFile, ManualRedirectStrategy };
|
|
5
5
|
export type * as Fireproof from 'use-fireproof';
|
|
6
6
|
export declare function toCloud(opts?: UseFpToCloudParam): ToCloudAttachable;
|
|
7
|
-
export declare
|
|
7
|
+
export declare function useFireproof(nameOrDatabase?: string | Database): {
|
|
8
8
|
database: Database;
|
|
9
9
|
useDocument: import("use-fireproof").UseDocument;
|
|
10
10
|
useLiveQuery: import("use-fireproof").UseLiveQuery;
|
|
@@ -22,14 +22,32 @@ export { default as ImgGen } from './components/ImgGen.js';
|
|
|
22
22
|
export type { ImgGenProps } from './components/ImgGen.js';
|
|
23
23
|
export { ControlsBar } from './components/ControlsBar.js';
|
|
24
24
|
export { PromptBar } from './components/PromptBar.js';
|
|
25
|
+
export { VibesSwitch } from './components/VibesSwitch/VibesSwitch.js';
|
|
26
|
+
export { VibesButton } from './components/VibesButton/VibesButton.js';
|
|
25
27
|
export { hashInput, useImageGen } from './hooks/image-gen/index.js';
|
|
26
|
-
export { defaultClasses
|
|
28
|
+
export { defaultClasses } from './utils/style-utils.js';
|
|
29
|
+
export type { ImgGenClasses } from '@vibes.diy/use-vibes-types';
|
|
27
30
|
export { base64ToFile } from './utils/base64.js';
|
|
28
31
|
export { ImgGenDisplay } from './components/ImgGenUtils/ImgGenDisplay.js';
|
|
29
32
|
export { ImgGenDisplayPlaceholder } from './components/ImgGenUtils/ImgGenDisplayPlaceholder.js';
|
|
30
33
|
export { ImgGenModal, type ImgGenModalProps } from './components/ImgGenUtils/ImgGenModal.js';
|
|
31
34
|
export { ImageOverlay } from './components/ImgGenUtils/overlays/ImageOverlay.js';
|
|
32
35
|
export { addNewVersion, MODULE_STATE } from './hooks/image-gen/utils.js';
|
|
33
|
-
export {
|
|
36
|
+
export type { ImageDocument, PartialImageDocument, UseImageGenOptions, UseImageGenResult, } from '@vibes.diy/use-vibes-types';
|
|
34
37
|
export { useVibes } from './hooks/vibes-gen/index.js';
|
|
35
|
-
export type { UseVibesOptions, UseVibesResult, VibeDocument } from '
|
|
38
|
+
export type { UseVibesOptions, UseVibesResult, VibeDocument } from '@vibes.diy/use-vibes-types';
|
|
39
|
+
export { VibeControl } from './components/VibeControl.js';
|
|
40
|
+
export type { VibeControlProps } from './components/VibeControl.js';
|
|
41
|
+
export { mountVibeControl, mountVibeControlToBody, autoMountVibeControl, } from './vibe-control-mount.js';
|
|
42
|
+
export type { MountVibeControlOptions, MountVibeControlResult } from './vibe-control-mount.js';
|
|
43
|
+
export { HiddenMenuWrapper } from './components/HiddenMenuWrapper/HiddenMenuWrapper.js';
|
|
44
|
+
export type { HiddenMenuWrapperProps } from './components/HiddenMenuWrapper/HiddenMenuWrapper.js';
|
|
45
|
+
export { mountHiddenMenuWrapper, mountHiddenMenuWrapperToBody, autoMountHiddenMenuWrapper, } from './vibe-hidden-menu-mount.js';
|
|
46
|
+
export type { MountHiddenMenuWrapperOptions, MountHiddenMenuWrapperResult, } from './vibe-hidden-menu-mount.js';
|
|
47
|
+
export { AuthWall } from './components/AuthWall/AuthWall.js';
|
|
48
|
+
export type { AuthWallProps } from './components/AuthWall/AuthWall.js';
|
|
49
|
+
export { mountAuthWall } from './vibe-auth-wall.js';
|
|
50
|
+
export type { MountAuthWallOptions, MountAuthWallResult } from './vibe-auth-wall.js';
|
|
51
|
+
export { vibeControlTheme, createVibeControlStyles, defaultVibeControlClasses, } from './utils/vibe-control-styles.js';
|
|
52
|
+
export type { VibeControlClasses } from './utils/vibe-control-styles.js';
|
|
53
|
+
export { hiddenMenuTheme } from './components/HiddenMenuWrapper/HiddenMenuWrapper.styles.js';
|
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export function toCloud(opts) {
|
|
|
24
24
|
});
|
|
25
25
|
return attachable;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export function useFireproof(nameOrDatabase) {
|
|
28
28
|
const instanceId = useId();
|
|
29
29
|
const dbName = typeof nameOrDatabase === 'string' ? nameOrDatabase : nameOrDatabase?.name || 'default';
|
|
30
30
|
const syncKey = `fireproof-sync-${dbName}`;
|
|
@@ -119,12 +119,14 @@ export const useFireproof = (nameOrDatabase) => {
|
|
|
119
119
|
disableSync,
|
|
120
120
|
syncEnabled,
|
|
121
121
|
};
|
|
122
|
-
}
|
|
122
|
+
}
|
|
123
123
|
import { callAI } from 'call-ai';
|
|
124
124
|
export { callAI, callAI as callAi };
|
|
125
125
|
export { default as ImgGen } from './components/ImgGen.js';
|
|
126
126
|
export { ControlsBar } from './components/ControlsBar.js';
|
|
127
127
|
export { PromptBar } from './components/PromptBar.js';
|
|
128
|
+
export { VibesSwitch } from './components/VibesSwitch/VibesSwitch.js';
|
|
129
|
+
export { VibesButton } from './components/VibesButton/VibesButton.js';
|
|
128
130
|
export { hashInput, useImageGen } from './hooks/image-gen/index.js';
|
|
129
131
|
export { defaultClasses } from './utils/style-utils.js';
|
|
130
132
|
export { base64ToFile } from './utils/base64.js';
|
|
@@ -134,4 +136,12 @@ export { ImgGenModal } from './components/ImgGenUtils/ImgGenModal.js';
|
|
|
134
136
|
export { ImageOverlay } from './components/ImgGenUtils/overlays/ImageOverlay.js';
|
|
135
137
|
export { addNewVersion, MODULE_STATE } from './hooks/image-gen/utils.js';
|
|
136
138
|
export { useVibes } from './hooks/vibes-gen/index.js';
|
|
139
|
+
export { VibeControl } from './components/VibeControl.js';
|
|
140
|
+
export { mountVibeControl, mountVibeControlToBody, autoMountVibeControl, } from './vibe-control-mount.js';
|
|
141
|
+
export { HiddenMenuWrapper } from './components/HiddenMenuWrapper/HiddenMenuWrapper.js';
|
|
142
|
+
export { mountHiddenMenuWrapper, mountHiddenMenuWrapperToBody, autoMountHiddenMenuWrapper, } from './vibe-hidden-menu-mount.js';
|
|
143
|
+
export { AuthWall } from './components/AuthWall/AuthWall.js';
|
|
144
|
+
export { mountAuthWall } from './vibe-auth-wall.js';
|
|
145
|
+
export { vibeControlTheme, createVibeControlStyles, defaultVibeControlClasses, } from './utils/vibe-control-styles.js';
|
|
146
|
+
export { hiddenMenuTheme } from './components/HiddenMenuWrapper/HiddenMenuWrapper.styles.js';
|
|
137
147
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EACL,SAAS,EACT,OAAO,EACP,OAAO,IAAI,eAAe,EAC1B,YAAY,IAAI,oBAAoB,GAGrC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAuB,CAAC;AAG5D,SAAS,eAAe,GAAG;IACzB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,QAAQ,EAAE,IAAI;QAAE,OAAO;IAE7D,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,oBAAoB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EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/use-vibes-base",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.15-dev02",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core components and utilities for use-vibes (internal workspace package)",
|
|
6
6
|
"exports": {
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
},
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@adviser/cement": "^0.4.
|
|
14
|
+
"@adviser/cement": "^0.4.43",
|
|
15
15
|
"@fireproof/core-runtime": "^0.23.14",
|
|
16
16
|
"@fireproof/core-types-base": "^0.23.14",
|
|
17
17
|
"@fireproof/core-types-protocols-cloud": "^0.23.14",
|
|
18
|
-
"@vibes.diy/prompts": "^0.12.
|
|
19
|
-
"
|
|
18
|
+
"@vibes.diy/prompts": "^0.12.15-dev02",
|
|
19
|
+
"@vibes.diy/use-vibes-types": "^0.12.15-dev02",
|
|
20
|
+
"call-ai": "^0.12.15-dev02",
|
|
20
21
|
"react-dom": "~19.1.0",
|
|
21
22
|
"use-fireproof": "^0.23.14",
|
|
22
23
|
"uuid": "^11.1.0"
|
|
@@ -25,12 +26,21 @@
|
|
|
25
26
|
"react": "~19.1.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
29
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
28
30
|
"@fireproof/core-cli": "^0.23.14",
|
|
31
|
+
"@storybook/addon-a11y": "^9.1.6",
|
|
32
|
+
"@storybook/addon-docs": "^9.1.6",
|
|
33
|
+
"@storybook/react": "^9.1.6",
|
|
34
|
+
"@storybook/react-vite": "^9.1.6",
|
|
29
35
|
"@types/react": "~19.1.0",
|
|
30
36
|
"@types/react-dom": "~19.1.0",
|
|
31
|
-
"
|
|
37
|
+
"storybook": "^9.1.6",
|
|
38
|
+
"typescript": "^5.9.3",
|
|
39
|
+
"vite": "^7.1.7"
|
|
32
40
|
},
|
|
33
41
|
"scripts": {
|
|
34
|
-
"build": "core-cli tsc"
|
|
42
|
+
"build": "core-cli tsc",
|
|
43
|
+
"storybook": "storybook dev -p 6007",
|
|
44
|
+
"build-storybook": "storybook build"
|
|
35
45
|
}
|
|
36
46
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import type { VibeControlProps } from '../components/VibeControl.js';
|
|
3
|
+
declare const meta: Meta<VibeControlProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<VibeControlProps>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const BottomLeft: Story;
|
|
8
|
+
export declare const TopRight: Story;
|
|
9
|
+
export declare const TopLeft: Story;
|
|
10
|
+
export declare const WithCustomContent: Story;
|
|
11
|
+
export declare const WithRichContent: Story;
|
|
12
|
+
export declare const Hidden: Story;
|
|
13
|
+
export declare const WithCustomStyling: Story;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VibeControl } from '../components/VibeControl.js';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Components/VibeControl',
|
|
5
|
+
component: VibeControl,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'fullscreen',
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: `
|
|
11
|
+
A floating action button that opens a full-screen overlay. Perfect for adding controls, settings, or additional content that doesn't interfere with the main UI.
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
- **Configurable positioning** - Choose from 4 corner positions
|
|
15
|
+
- **Portal rendering** - Avoids z-index conflicts
|
|
16
|
+
- **Keyboard navigation** - Escape key to close
|
|
17
|
+
- **Custom content** - Any React children supported
|
|
18
|
+
- **Event callbacks** - onOpen/onClose integration hooks
|
|
19
|
+
- **Responsive design** - Works on mobile and desktop
|
|
20
|
+
`,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
argTypes: {
|
|
25
|
+
position: {
|
|
26
|
+
control: { type: 'select' },
|
|
27
|
+
options: ['bottom-right', 'bottom-left', 'top-right', 'top-left'],
|
|
28
|
+
description: 'Position of the floating button',
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
control: { type: 'text' },
|
|
32
|
+
description: 'Text displayed on the button',
|
|
33
|
+
},
|
|
34
|
+
visible: {
|
|
35
|
+
control: { type: 'boolean' },
|
|
36
|
+
description: 'Whether to show the component',
|
|
37
|
+
},
|
|
38
|
+
onOpen: {
|
|
39
|
+
action: 'opened',
|
|
40
|
+
description: 'Callback when overlay opens',
|
|
41
|
+
},
|
|
42
|
+
onClose: {
|
|
43
|
+
action: 'closed',
|
|
44
|
+
description: 'Callback when overlay closes',
|
|
45
|
+
},
|
|
46
|
+
children: {
|
|
47
|
+
control: { type: 'text' },
|
|
48
|
+
description: 'Custom content for the overlay',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export default meta;
|
|
53
|
+
export const Default = {
|
|
54
|
+
args: {
|
|
55
|
+
label: 'Open Vibes',
|
|
56
|
+
position: 'bottom-right',
|
|
57
|
+
visible: true,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export const BottomLeft = {
|
|
61
|
+
args: {
|
|
62
|
+
label: 'Bottom Left',
|
|
63
|
+
position: 'bottom-left',
|
|
64
|
+
visible: true,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
export const TopRight = {
|
|
68
|
+
args: {
|
|
69
|
+
label: 'Top Right',
|
|
70
|
+
position: 'top-right',
|
|
71
|
+
visible: true,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export const TopLeft = {
|
|
75
|
+
args: {
|
|
76
|
+
label: 'Top Left',
|
|
77
|
+
position: 'top-left',
|
|
78
|
+
visible: true,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
export const WithCustomContent = {
|
|
82
|
+
args: {
|
|
83
|
+
label: 'Settings',
|
|
84
|
+
position: 'bottom-right',
|
|
85
|
+
visible: true,
|
|
86
|
+
children: (React.createElement("div", null, React.createElement("h3", { style: { margin: '0 0 16px 0', fontSize: '24px', fontWeight: '700' } }, "Settings Panel"), React.createElement("div", { style: { marginBottom: '16px' } }, React.createElement("label", { style: { display: 'block', marginBottom: '8px', fontWeight: '600' } }, "Theme Preference"), React.createElement("select", { style: { width: '100%', padding: '8px', borderRadius: '4px', border: '1px solid #ccc' } }, React.createElement("option", null, "Light"), React.createElement("option", null, "Dark"), React.createElement("option", null, "Auto"))), React.createElement("div", { style: { marginBottom: '16px' } }, React.createElement("label", { style: { display: 'flex', alignItems: 'center', gap: '8px' } }, React.createElement("input", { type: "checkbox", defaultChecked: true }), React.createElement("span", null, "Enable notifications"))), React.createElement("div", { style: { marginBottom: '16px' } }, React.createElement("label", { style: { display: 'flex', alignItems: 'center', gap: '8px' } }, React.createElement("input", { type: "checkbox" }), React.createElement("span", null, "Auto-save changes"))), React.createElement("div", { style: { display: 'flex', gap: '8px', marginTop: '20px' } }, React.createElement("button", { style: {
|
|
87
|
+
padding: '8px 16px',
|
|
88
|
+
backgroundColor: '#0066cc',
|
|
89
|
+
color: 'white',
|
|
90
|
+
border: 'none',
|
|
91
|
+
borderRadius: '4px',
|
|
92
|
+
cursor: 'pointer',
|
|
93
|
+
} }, "Save Changes"), React.createElement("button", { style: {
|
|
94
|
+
padding: '8px 16px',
|
|
95
|
+
backgroundColor: '#f5f5f5',
|
|
96
|
+
color: '#333',
|
|
97
|
+
border: '1px solid #ccc',
|
|
98
|
+
borderRadius: '4px',
|
|
99
|
+
cursor: 'pointer',
|
|
100
|
+
} }, "Cancel")))),
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
export const WithRichContent = {
|
|
104
|
+
args: {
|
|
105
|
+
label: 'Help & Info',
|
|
106
|
+
position: 'bottom-right',
|
|
107
|
+
visible: true,
|
|
108
|
+
children: (React.createElement("div", null, React.createElement("h3", { style: { margin: '0 0 16px 0', fontSize: '24px', fontWeight: '700' } }, "Welcome to VibeControl"), React.createElement("div", { style: { marginBottom: '20px', lineHeight: '1.6' } }, React.createElement("p", null, "VibeControl provides a floating action button that opens rich overlay content. Perfect for settings, help content, or any additional functionality.")), React.createElement("div", { style: {
|
|
109
|
+
marginBottom: '20px',
|
|
110
|
+
padding: '16px',
|
|
111
|
+
backgroundColor: '#f0f8ff',
|
|
112
|
+
borderRadius: '8px',
|
|
113
|
+
border: '1px solid #bbdefb',
|
|
114
|
+
} }, React.createElement("h4", { style: { margin: '0 0 8px 0', color: '#1976d2' } }, "Key Features"), React.createElement("ul", { style: { margin: 0, paddingLeft: '20px', color: '#1976d2' } }, React.createElement("li", null, "Portal rendering avoids z-index issues"), React.createElement("li", null, "Escape key and backdrop click to close"), React.createElement("li", null, "Four corner position options"), React.createElement("li", null, "Fully customizable overlay content"), React.createElement("li", null, "Event callbacks for integration"))), React.createElement("div", { style: {
|
|
115
|
+
marginBottom: '20px',
|
|
116
|
+
padding: '16px',
|
|
117
|
+
backgroundColor: '#f3e5f5',
|
|
118
|
+
borderRadius: '8px',
|
|
119
|
+
border: '1px solid #e1bee7',
|
|
120
|
+
} }, React.createElement("h4", { style: { margin: '0 0 8px 0', color: '#7b1fa2' } }, "Usage Examples"), React.createElement("ul", { style: { margin: 0, paddingLeft: '20px', color: '#7b1fa2' } }, React.createElement("li", null, "Application settings and preferences"), React.createElement("li", null, "User help and documentation"), React.createElement("li", null, "Additional navigation or tools"), React.createElement("li", null, "Context-sensitive controls"))), React.createElement("button", { style: {
|
|
121
|
+
width: '100%',
|
|
122
|
+
padding: '12px',
|
|
123
|
+
backgroundColor: '#4caf50',
|
|
124
|
+
color: 'white',
|
|
125
|
+
border: 'none',
|
|
126
|
+
borderRadius: '4px',
|
|
127
|
+
fontSize: '16px',
|
|
128
|
+
cursor: 'pointer',
|
|
129
|
+
}, onClick: () => alert('Action triggered!') }, "Try It Out!"))),
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
export const Hidden = {
|
|
133
|
+
args: {
|
|
134
|
+
label: "This Won't Show",
|
|
135
|
+
position: 'bottom-right',
|
|
136
|
+
visible: false,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
export const WithCustomStyling = {
|
|
140
|
+
args: {
|
|
141
|
+
label: '🎨 Styled',
|
|
142
|
+
position: 'bottom-right',
|
|
143
|
+
visible: true,
|
|
144
|
+
classes: {
|
|
145
|
+
button: 'custom-button',
|
|
146
|
+
backdrop: 'custom-backdrop',
|
|
147
|
+
overlay: 'custom-overlay',
|
|
148
|
+
overlayTitle: 'custom-title',
|
|
149
|
+
closeButton: 'custom-close',
|
|
150
|
+
content: 'custom-content',
|
|
151
|
+
},
|
|
152
|
+
children: (React.createElement("div", null, React.createElement("h3", null, "Custom Styled Overlay"), React.createElement("p", null, "This example shows how you can customize the styling using CSS classes."), React.createElement("p", null, "You can override the default styles by providing custom classes for each element of the component."))),
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=VibeControl.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VibeControl.stories.js","sourceRoot":"","sources":["../../jsr/stories/VibeControl.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,IAAI,GAA2B;IACnC,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE;QACV,MAAM,E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D,QAAQ,EAAE,CACR,iCACE,wDAA8B,EAC9B,yGAA8E,EAC9E,oIAGI,CACA,CACP;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import type { MountVibeControlOptions } from '../vibe-control-mount.js';
|
|
3
|
+
declare const meta: Meta<{
|
|
4
|
+
mountType: 'container' | 'body' | 'auto';
|
|
5
|
+
options?: Partial<MountVibeControlOptions>;
|
|
6
|
+
}>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<{
|
|
9
|
+
mountType: 'container' | 'body' | 'auto';
|
|
10
|
+
options?: Partial<MountVibeControlOptions>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const MountToContainer: Story;
|
|
13
|
+
export declare const MountToBody: Story;
|
|
14
|
+
export declare const AutoMount: Story;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { mountVibeControl, mountVibeControlToBody, autoMountVibeControl, } from '../vibe-control-mount.js';
|
|
3
|
+
function MountDemo({ mountType, options = {}, }) {
|
|
4
|
+
const containerRef = useRef(null);
|
|
5
|
+
const [mounted, setMounted] = useState(false);
|
|
6
|
+
const [instance, setInstance] = useState(null);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!mounted)
|
|
9
|
+
return;
|
|
10
|
+
let control = null;
|
|
11
|
+
try {
|
|
12
|
+
switch (mountType) {
|
|
13
|
+
case 'container':
|
|
14
|
+
if (containerRef.current) {
|
|
15
|
+
control = mountVibeControl({
|
|
16
|
+
container: containerRef.current,
|
|
17
|
+
label: 'Mounted Control',
|
|
18
|
+
position: 'bottom-right',
|
|
19
|
+
onOpen: () => console.log('Container-mounted control opened'),
|
|
20
|
+
onClose: () => console.log('Container-mounted control closed'),
|
|
21
|
+
children: React.createElement('div', {}, React.createElement('h3', {}, 'Container Mount Demo'), React.createElement('p', {}, 'This VibeControl was mounted using mountVibeControl() to a specific container element.'), React.createElement('div', {
|
|
22
|
+
style: {
|
|
23
|
+
marginTop: '16px',
|
|
24
|
+
padding: '12px',
|
|
25
|
+
backgroundColor: '#e3f2fd',
|
|
26
|
+
borderRadius: '4px',
|
|
27
|
+
},
|
|
28
|
+
}, React.createElement('strong', {}, 'Benefits:'), React.createElement('ul', { style: { marginTop: '8px' } }, React.createElement('li', {}, 'Scoped to specific DOM element'), React.createElement('li', {}, 'No React dependency required'), React.createElement('li', {}, 'Dynamic prop updates supported'), React.createElement('li', {}, 'Clean unmounting')))),
|
|
29
|
+
...options,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
case 'body':
|
|
34
|
+
control = mountVibeControlToBody({
|
|
35
|
+
label: 'Body Mount',
|
|
36
|
+
position: 'bottom-left',
|
|
37
|
+
onOpen: () => console.log('Body-mounted control opened'),
|
|
38
|
+
onClose: () => console.log('Body-mounted control closed'),
|
|
39
|
+
children: React.createElement('div', {}, React.createElement('h3', {}, 'Body Mount Demo'), React.createElement('p', {}, 'This VibeControl was mounted using mountVibeControlToBody().'), React.createElement('div', {
|
|
40
|
+
style: {
|
|
41
|
+
marginTop: '16px',
|
|
42
|
+
padding: '12px',
|
|
43
|
+
backgroundColor: '#f3e5f5',
|
|
44
|
+
borderRadius: '4px',
|
|
45
|
+
},
|
|
46
|
+
}, React.createElement('strong', {}, 'Use Cases:'), React.createElement('ul', { style: { marginTop: '8px' } }, React.createElement('li', {}, 'Global application controls'), React.createElement('li', {}, 'Site-wide settings access'), React.createElement('li', {}, 'Help/support overlay'), React.createElement('li', {}, 'User account management')))),
|
|
47
|
+
...options,
|
|
48
|
+
});
|
|
49
|
+
break;
|
|
50
|
+
case 'auto':
|
|
51
|
+
window.VIBE_CONTROL_CONFIG = {
|
|
52
|
+
label: 'Auto Mount',
|
|
53
|
+
position: 'top-right',
|
|
54
|
+
children: React.createElement('div', {}, React.createElement('h3', {}, 'Auto Mount Demo'), React.createElement('p', {}, 'This VibeControl was auto-mounted using global configuration.'), React.createElement('div', {
|
|
55
|
+
style: {
|
|
56
|
+
marginTop: '16px',
|
|
57
|
+
padding: '12px',
|
|
58
|
+
backgroundColor: '#fff3e0',
|
|
59
|
+
borderRadius: '4px',
|
|
60
|
+
},
|
|
61
|
+
}, React.createElement('strong', {}, 'Perfect for:'), React.createElement('ul', { style: { marginTop: '8px' } }, React.createElement('li', {}, 'CDN-based integration'), React.createElement('li', {}, 'No-code implementations'), React.createElement('li', {}, 'Third-party embeds'), React.createElement('li', {}, 'Quick prototyping')))),
|
|
62
|
+
...options,
|
|
63
|
+
};
|
|
64
|
+
control = autoMountVibeControl();
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
setInstance(control);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
console.error(`Failed to mount ${mountType}:`, error);
|
|
71
|
+
}
|
|
72
|
+
return () => {
|
|
73
|
+
if (control && typeof control.unmount === 'function') {
|
|
74
|
+
control.unmount();
|
|
75
|
+
}
|
|
76
|
+
if (mountType === 'auto') {
|
|
77
|
+
delete window.VIBE_CONTROL_CONFIG;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}, [mounted, mountType, options]);
|
|
81
|
+
const handleMount = () => setMounted(true);
|
|
82
|
+
const handleUnmount = () => {
|
|
83
|
+
if (instance && typeof instance.unmount === 'function') {
|
|
84
|
+
instance.unmount();
|
|
85
|
+
}
|
|
86
|
+
setMounted(false);
|
|
87
|
+
setInstance(null);
|
|
88
|
+
};
|
|
89
|
+
const handleUpdate = () => {
|
|
90
|
+
if (instance && typeof instance.update === 'function') {
|
|
91
|
+
instance.update({
|
|
92
|
+
label: `Updated ${Date.now()}`,
|
|
93
|
+
position: 'top-left',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return (React.createElement("div", { style: { padding: '20px', maxWidth: '600px' } }, React.createElement("h3", null, mountType === 'container' ? 'Container' : mountType === 'body' ? 'Body' : 'Auto', " Mount Example"), React.createElement("div", { style: { marginBottom: '16px', display: 'flex', gap: '8px', flexWrap: 'wrap' } }, React.createElement("button", { onClick: handleMount, disabled: mounted, style: {
|
|
98
|
+
padding: '8px 16px',
|
|
99
|
+
backgroundColor: mounted ? '#ccc' : '#4caf50',
|
|
100
|
+
color: 'white',
|
|
101
|
+
border: 'none',
|
|
102
|
+
borderRadius: '4px',
|
|
103
|
+
cursor: mounted ? 'not-allowed' : 'pointer',
|
|
104
|
+
} }, "Mount Control"), React.createElement("button", { onClick: handleUpdate, disabled: !mounted || !instance, style: {
|
|
105
|
+
padding: '8px 16px',
|
|
106
|
+
backgroundColor: !mounted || !instance ? '#ccc' : '#ff9800',
|
|
107
|
+
color: 'white',
|
|
108
|
+
border: 'none',
|
|
109
|
+
borderRadius: '4px',
|
|
110
|
+
cursor: !mounted || !instance ? 'not-allowed' : 'pointer',
|
|
111
|
+
} }, "Update Props"), React.createElement("button", { onClick: handleUnmount, disabled: !mounted, style: {
|
|
112
|
+
padding: '8px 16px',
|
|
113
|
+
backgroundColor: !mounted ? '#ccc' : '#f44336',
|
|
114
|
+
color: 'white',
|
|
115
|
+
border: 'none',
|
|
116
|
+
borderRadius: '4px',
|
|
117
|
+
cursor: !mounted ? 'not-allowed' : 'pointer',
|
|
118
|
+
} }, "Unmount")), mountType === 'container' && (React.createElement("div", { ref: containerRef, style: {
|
|
119
|
+
position: 'relative',
|
|
120
|
+
height: '200px',
|
|
121
|
+
border: '2px dashed #ccc',
|
|
122
|
+
borderRadius: '4px',
|
|
123
|
+
display: 'flex',
|
|
124
|
+
alignItems: 'center',
|
|
125
|
+
justifyContent: 'center',
|
|
126
|
+
backgroundColor: mounted ? '#f0f8ff' : '#fafafa',
|
|
127
|
+
} }, mounted ? (React.createElement("div", { style: { textAlign: 'center', color: '#666' } }, React.createElement("p", null, React.createElement("strong", null, "VibeControl mounted!")), React.createElement("p", null, "Look for the button in the bottom-right of this container."))) : (React.createElement("p", { style: { color: '#999', margin: 0 } }, "Click \"Mount Control\" to see the VibeControl in this container")))), mounted && (React.createElement("div", { style: {
|
|
128
|
+
marginTop: '16px',
|
|
129
|
+
padding: '12px',
|
|
130
|
+
backgroundColor: '#f0f8ff',
|
|
131
|
+
borderRadius: '4px',
|
|
132
|
+
} }, React.createElement("strong", null, "Status:"), " VibeControl is mounted and active", mountType !== 'container' && (React.createElement("p", { style: { margin: '8px 0 0 0', fontSize: '0.9em', color: '#666' } }, "Look for the floating button positioned on the", ' ', mountType === 'body' ? 'page' : 'screen'))))));
|
|
133
|
+
}
|
|
134
|
+
const meta = {
|
|
135
|
+
title: 'Components/VibeControl Mount Functions',
|
|
136
|
+
component: MountDemo,
|
|
137
|
+
parameters: {
|
|
138
|
+
layout: 'fullscreen',
|
|
139
|
+
docs: {
|
|
140
|
+
description: {
|
|
141
|
+
component: `
|
|
142
|
+
Demonstrates the mount functions for using VibeControl in non-React environments.
|
|
143
|
+
|
|
144
|
+
### Mount Functions Available
|
|
145
|
+
- **\`mountVibeControl(options)\`** - Mount to a specific DOM element
|
|
146
|
+
- **\`mountVibeControlToBody(props)\`** - Convenience function for body mounting
|
|
147
|
+
- **\`autoMountVibeControl()\`** - Auto-mount from global config (perfect for CDN usage)
|
|
148
|
+
|
|
149
|
+
### Features
|
|
150
|
+
- **Dynamic updates** - Use \`instance.update(props)\` to change properties
|
|
151
|
+
- **Clean unmounting** - Use \`instance.unmount()\` for proper cleanup
|
|
152
|
+
- **Event callbacks** - Full support for onOpen/onClose handlers
|
|
153
|
+
- **No React required** - Works in any JavaScript environment
|
|
154
|
+
`,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
argTypes: {
|
|
159
|
+
mountType: {
|
|
160
|
+
control: { type: 'select' },
|
|
161
|
+
options: ['container', 'body', 'auto'],
|
|
162
|
+
description: 'Type of mount function to demonstrate',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
export default meta;
|
|
167
|
+
export const MountToContainer = {
|
|
168
|
+
args: {
|
|
169
|
+
mountType: 'container',
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
export const MountToBody = {
|
|
173
|
+
args: {
|
|
174
|
+
mountType: 'body',
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
export const AutoMount = {
|
|
178
|
+
args: {
|
|
179
|
+
mountType: 'auto',
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=VibeControlMount.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VibeControlMount.stories.js","sourceRoot":"","sources":["../../jsr/stories/VibeControlMount.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAIlC,SAAS,SAAS,CAAC,EACjB,SAAS,EACT,OAAO,GAAG,EAAE,GAIb,EAAE;IACD,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAA6C,IAAI,CAAC,CAAC;IAE3F,SAAS,CAAC,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,IAAI,OAAO,GAA+C,IAAI,CAAC;QAE/D,IAAI,CAAC;YACH,QAAQ,SAAS,EAAE,CAAC;gBAClB,KAAK,WAAW;oBACd,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;wBACzB,OAAO,GAAG,gBAAgB,CAAC;4BACzB,SAAS,EAAE,YAAY,CAAC,OAAO;4BAC/B,KAAK,EAAE,iBAAiB;4BACxB,QA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;AAGF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM;KAClB;CACF,CAAC"}
|
package/tsconfig.json
CHANGED
package/utils/style-utils.d.ts
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
+
import type { ImgGenClasses } from '@vibes.diy/use-vibes-types';
|
|
2
|
+
export type { ImgGenClasses };
|
|
1
3
|
export declare function combineClasses(...classes: (string | boolean | null | undefined)[]): string;
|
|
2
|
-
export interface ImgGenClasses {
|
|
3
|
-
readonly root: string;
|
|
4
|
-
readonly container: string;
|
|
5
|
-
readonly image: string;
|
|
6
|
-
readonly overlay: string;
|
|
7
|
-
readonly progress: string;
|
|
8
|
-
readonly placeholder: string;
|
|
9
|
-
readonly error: string;
|
|
10
|
-
readonly controls: string;
|
|
11
|
-
readonly button: string;
|
|
12
|
-
readonly prompt: string;
|
|
13
|
-
readonly deleteOverlay: string;
|
|
14
|
-
readonly dropZone: string;
|
|
15
|
-
readonly uploadWaiting: string;
|
|
16
|
-
}
|
|
17
4
|
export declare const defaultClasses: Partial<ImgGenClasses>;
|
package/utils/style-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-utils.js","sourceRoot":"","sources":["../../jsr/utils/style-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style-utils.js","sourceRoot":"","sources":["../../jsr/utils/style-utils.ts"],"names":[],"mappings":"AAwBA,MAAM,UAAU,cAAc,CAAC,GAAG,OAAgD,EAAU;IAE1F,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,CAAC;QAC5B,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;IAAA,CACF,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAAA,CAC7B;AAKD,MAAM,CAAC,MAAM,cAAc,GAA2B,EAAE,CAAC"}
|