@circle-vibe/shared 1.1.0 → 1.1.2
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/build/index.js +1 -1
- package/build/index.js.LICENSE.txt +15 -0
- package/build/src/components/dropdown/dropdown-portal/dropdown-portal.d.ts +7 -0
- package/build/src/components/dropdown/dropdown-portal/dropdown-portal.js +19 -0
- package/build/src/components/dropdown/dropdown-portal/dropdown-portal.js.map +1 -0
- package/build/src/components/dropdown/dropdown.d.ts +14 -0
- package/build/src/components/dropdown/dropdown.js +23 -0
- package/build/src/components/dropdown/dropdown.js.map +1 -0
- package/build/src/components/dropdown/index.d.ts +1 -0
- package/build/src/components/dropdown/index.js +18 -0
- package/build/src/components/dropdown/index.js.map +1 -0
- package/build/src/components/index.d.ts +4 -0
- package/build/src/components/index.js +4 -0
- package/build/src/components/index.js.map +1 -1
- package/build/src/components/menu/index.d.ts +2 -0
- package/build/src/components/menu/index.js +19 -0
- package/build/src/components/menu/index.js.map +1 -0
- package/build/src/components/menu/menu.context.d.ts +5 -0
- package/build/src/components/menu/menu.context.js +12 -0
- package/build/src/components/menu/menu.context.js.map +1 -0
- package/build/src/components/menu/menu.d.ts +14 -0
- package/build/src/components/menu/menu.js +32 -0
- package/build/src/components/menu/menu.js.map +1 -0
- package/build/src/components/menu/types/index.d.ts +1 -0
- package/build/src/components/menu/types/index.js +18 -0
- package/build/src/components/menu/types/index.js.map +1 -0
- package/build/src/components/menu/types/menu-button.type.d.ts +3 -0
- package/build/src/components/menu/types/menu-button.type.js +3 -0
- package/build/src/components/menu/types/menu-button.type.js.map +1 -0
- package/build/src/components/popover/index.d.ts +1 -0
- package/build/src/components/popover/index.js +18 -0
- package/build/src/components/popover/index.js.map +1 -0
- package/build/src/components/popover/popover.d.ts +10 -0
- package/build/src/components/popover/popover.js +18 -0
- package/build/src/components/popover/popover.js.map +1 -0
- package/build/src/components/tooltip/index.d.ts +1 -0
- package/build/src/components/tooltip/index.js +18 -0
- package/build/src/components/tooltip/index.js.map +1 -0
- package/build/src/components/tooltip/tooltip-content/tooltip-content.d.ts +10 -0
- package/build/src/components/tooltip/tooltip-content/tooltip-content.js +18 -0
- package/build/src/components/tooltip/tooltip-content/tooltip-content.js.map +1 -0
- package/build/src/components/tooltip/tooltip.d.ts +8 -0
- package/build/src/components/tooltip/tooltip.js +21 -0
- package/build/src/components/tooltip/tooltip.js.map +1 -0
- package/build/src/constants/animation-in-bottom-position.d.ts +2 -0
- package/build/src/constants/animation-in-bottom-position.js +23 -0
- package/build/src/constants/animation-in-bottom-position.js.map +1 -0
- package/build/src/constants/default-middleware.d.ts +15 -0
- package/build/src/constants/default-middleware.js +6 -0
- package/build/src/constants/default-middleware.js.map +1 -0
- package/build/src/constants/default-tooltip-animation.d.ts +2 -0
- package/build/src/constants/default-tooltip-animation.js +10 -0
- package/build/src/constants/default-tooltip-animation.js.map +1 -0
- package/build/src/constants/index.d.ts +3 -0
- package/build/src/constants/index.js +3 -0
- package/build/src/constants/index.js.map +1 -1
- package/build/src/enums/chat-socket-keys.d.ts +8 -0
- package/build/src/enums/chat-socket-keys.js +13 -0
- package/build/src/enums/chat-socket-keys.js.map +1 -0
- package/build/src/enums/index.d.ts +1 -0
- package/build/src/enums/index.js +1 -0
- package/build/src/enums/index.js.map +1 -1
- package/build/src/hooks/index.d.ts +3 -0
- package/build/src/hooks/index.js +3 -0
- package/build/src/hooks/index.js.map +1 -1
- package/build/src/hooks/use-dropdown/index.d.ts +1 -0
- package/build/src/hooks/use-dropdown/index.js +18 -0
- package/build/src/hooks/use-dropdown/index.js.map +1 -0
- package/build/src/hooks/use-dropdown/use-dropdown.d.ts +20 -0
- package/build/src/hooks/use-dropdown/use-dropdown.js +44 -0
- package/build/src/hooks/use-dropdown/use-dropdown.js.map +1 -0
- package/build/src/hooks/use-popover/index.d.ts +1 -0
- package/build/src/hooks/use-popover/index.js +18 -0
- package/build/src/hooks/use-popover/index.js.map +1 -0
- package/build/src/hooks/use-popover/use-popover.d.ts +20 -0
- package/build/src/hooks/use-popover/use-popover.js +43 -0
- package/build/src/hooks/use-popover/use-popover.js.map +1 -0
- package/build/src/hooks/use-tooltip/index.d.ts +1 -0
- package/build/src/hooks/use-tooltip/index.js +18 -0
- package/build/src/hooks/use-tooltip/index.js.map +1 -0
- package/build/src/hooks/use-tooltip/use-tooltip.d.ts +17 -0
- package/build/src/hooks/use-tooltip/use-tooltip.js +42 -0
- package/build/src/hooks/use-tooltip/use-tooltip.js.map +1 -0
- package/build/src/models/chat.d.ts +1 -0
- package/build/src/types/chat-socket-params.d.ts +10 -0
- package/build/src/types/chat-socket-params.js +3 -0
- package/build/src/types/chat-socket-params.js.map +1 -0
- package/build/src/types/index.d.ts +1 -0
- package/build/src/types/index.js +1 -0
- package/build/src/types/index.js.map +1 -1
- package/package.json +8 -2
package/build/src/hooks/index.js
CHANGED
|
@@ -15,4 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./use-form-context"), exports);
|
|
18
|
+
__exportStar(require("./use-popover"), exports);
|
|
19
|
+
__exportStar(require("./use-tooltip"), exports);
|
|
20
|
+
__exportStar(require("./use-dropdown"), exports);
|
|
18
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,gDAA8B;AAC9B,gDAA8B;AAC9B,iDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-dropdown';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./use-dropdown"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/use-dropdown/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StyleHTMLAttributes } from "react";
|
|
2
|
+
import { Placement } from "@floating-ui/react";
|
|
3
|
+
export interface UseDropdownOptions {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
}
|
|
8
|
+
export declare const useDropdown: (options?: UseDropdownOptions) => {
|
|
9
|
+
open: boolean;
|
|
10
|
+
referenceProps: {
|
|
11
|
+
ref: ((node: import("@floating-ui/react-dom").ReferenceType | null) => void) & ((node: import("@floating-ui/react").ReferenceType | null) => void);
|
|
12
|
+
};
|
|
13
|
+
contentProps: {
|
|
14
|
+
style: import("react").CSSProperties;
|
|
15
|
+
open: boolean;
|
|
16
|
+
ref: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
17
|
+
};
|
|
18
|
+
setStatus: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
19
|
+
transitionStyles: StyleHTMLAttributes<HTMLDivElement>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDropdown = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_2 = require("@floating-ui/react");
|
|
6
|
+
const default_middleware_1 = require("../../constants/default-middleware");
|
|
7
|
+
const constants_1 = require("src/constants");
|
|
8
|
+
const useDropdown = (options) => {
|
|
9
|
+
const [open, onOpenChange] = (0, react_1.useState)(options?.open ?? false);
|
|
10
|
+
const { refs, floatingStyles, context } = (0, react_2.useFloating)({
|
|
11
|
+
whileElementsMounted: react_2.autoUpdate,
|
|
12
|
+
placement: "bottom",
|
|
13
|
+
transform: true,
|
|
14
|
+
strategy: "fixed",
|
|
15
|
+
middleware: default_middleware_1.DEFAULT_MIDDLEWARE,
|
|
16
|
+
...(options?.open !== undefined && options.onOpenChange
|
|
17
|
+
? { ...options }
|
|
18
|
+
: { open, onOpenChange }),
|
|
19
|
+
...options,
|
|
20
|
+
});
|
|
21
|
+
const { getReferenceProps, getFloatingProps } = (0, react_2.useInteractions)([
|
|
22
|
+
(0, react_2.useDismiss)(context),
|
|
23
|
+
(0, react_2.useClick)(context),
|
|
24
|
+
]);
|
|
25
|
+
const { setReference, setFloating } = refs;
|
|
26
|
+
const { isMounted, styles: transitionStyles } = (0, react_2.useTransitionStyles)(context, constants_1.DROPDOWN_ANIMATION_IN_BOTTOM_POSITION);
|
|
27
|
+
return {
|
|
28
|
+
open: isMounted,
|
|
29
|
+
referenceProps: {
|
|
30
|
+
ref: setReference,
|
|
31
|
+
...getReferenceProps(),
|
|
32
|
+
},
|
|
33
|
+
contentProps: {
|
|
34
|
+
open: isMounted,
|
|
35
|
+
ref: setFloating,
|
|
36
|
+
...getFloatingProps(),
|
|
37
|
+
style: floatingStyles,
|
|
38
|
+
},
|
|
39
|
+
setStatus: onOpenChange,
|
|
40
|
+
transitionStyles: transitionStyles,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
exports.useDropdown = useDropdown;
|
|
44
|
+
//# sourceMappingURL=use-dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-dropdown.js","sourceRoot":"","sources":["../../../../src/hooks/use-dropdown/use-dropdown.ts"],"names":[],"mappings":";;;AAAA,iCAAsD;AACtD,8CAQ4B;AAC5B,2EAAwE;AACxE,6CAAsE;AAQ/D,MAAM,WAAW,GAAG,CAAC,OAA4B,EAAE,EAAE;IAC1D,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,EAAE,IAAI,IAAI,KAAK,CAAC,CAAC;IAC9D,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAA,mBAAW,EAAC;QACpD,oBAAoB,EAAE,kBAAU;QAChC,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,OAAO;QACjB,UAAU,EAAE,uCAAkB;QAC9B,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,YAAY;YACrD,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE;YAChB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAC3B,GAAG,OAAO;KACX,CAAC,CAAC;IACH,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,IAAA,uBAAe,EAAC;QAC9D,IAAA,kBAAU,EAAC,OAAO,CAAC;QACnB,IAAA,gBAAQ,EAAC,OAAO,CAAC;KAClB,CAAC,CAAC;IACH,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC3C,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,2BAAmB,EACjE,OAAO,EACP,iDAAqC,CACtC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,SAAS;QACf,cAAc,EAAE;YACd,GAAG,EAAE,YAAY;YACjB,GAAG,iBAAiB,EAAE;SACvB;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,WAAW;YAChB,GAAG,gBAAgB,EAAE;YACrB,KAAK,EAAE,cAAc;SACtB;QACD,SAAS,EAAE,YAAY;QACvB,gBAAgB,EAAE,gBAAuD;KAC1E,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,WAAW,eAsCtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-popover';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./use-popover"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/use-popover/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Placement } from "@floating-ui/react";
|
|
3
|
+
export interface UsePopoverOptions {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
}
|
|
8
|
+
export declare const usePopover: (options?: UsePopoverOptions) => {
|
|
9
|
+
open: boolean;
|
|
10
|
+
referenceProps: {
|
|
11
|
+
ref: ((node: import("@floating-ui/react-dom").ReferenceType | null) => void) & ((node: import("@floating-ui/react").ReferenceType | null) => void);
|
|
12
|
+
};
|
|
13
|
+
contentProps: {
|
|
14
|
+
style: import("react").CSSProperties;
|
|
15
|
+
open: boolean;
|
|
16
|
+
ref: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
17
|
+
};
|
|
18
|
+
setStatus: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
19
|
+
transitionStyles: import("react").CSSProperties;
|
|
20
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePopover = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_2 = require("@floating-ui/react");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const usePopover = (options) => {
|
|
8
|
+
const [open, onOpenChange] = (0, react_1.useState)(options?.open ?? false);
|
|
9
|
+
const { refs, floatingStyles, context } = (0, react_2.useFloating)({
|
|
10
|
+
whileElementsMounted: react_2.autoUpdate,
|
|
11
|
+
placement: "bottom",
|
|
12
|
+
transform: true,
|
|
13
|
+
strategy: "fixed",
|
|
14
|
+
middleware: constants_1.DEFAULT_MIDDLEWARE,
|
|
15
|
+
...(options?.open !== undefined && options.onOpenChange
|
|
16
|
+
? { ...options }
|
|
17
|
+
: { open, onOpenChange }),
|
|
18
|
+
...options,
|
|
19
|
+
});
|
|
20
|
+
const { getReferenceProps, getFloatingProps } = (0, react_2.useInteractions)([
|
|
21
|
+
(0, react_2.useDismiss)(context),
|
|
22
|
+
(0, react_2.useClick)(context),
|
|
23
|
+
]);
|
|
24
|
+
const { setReference, setFloating } = refs;
|
|
25
|
+
const { isMounted, styles: transitionStyles } = (0, react_2.useTransitionStyles)(context, constants_1.DROPDOWN_ANIMATION_IN_BOTTOM_POSITION);
|
|
26
|
+
return {
|
|
27
|
+
open,
|
|
28
|
+
referenceProps: {
|
|
29
|
+
ref: setReference,
|
|
30
|
+
...getReferenceProps(),
|
|
31
|
+
},
|
|
32
|
+
contentProps: {
|
|
33
|
+
open: isMounted,
|
|
34
|
+
ref: setFloating,
|
|
35
|
+
...getFloatingProps(),
|
|
36
|
+
style: floatingStyles,
|
|
37
|
+
},
|
|
38
|
+
setStatus: onOpenChange,
|
|
39
|
+
transitionStyles,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.usePopover = usePopover;
|
|
43
|
+
//# sourceMappingURL=use-popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-popover.js","sourceRoot":"","sources":["../../../../src/hooks/use-popover/use-popover.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,8CAQ4B;AAC5B,+CAGyB;AAQlB,MAAM,UAAU,GAAG,CAAC,OAA2B,EAAE,EAAE;IACxD,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,EAAE,IAAI,IAAI,KAAK,CAAC,CAAC;IAC9D,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAA,mBAAW,EAAC;QACpD,oBAAoB,EAAE,kBAAU;QAChC,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,OAAO;QACjB,UAAU,EAAE,8BAAkB;QAC9B,GAAG,CAAC,OAAO,EAAE,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,YAAY;YACrD,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE;YAChB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAC3B,GAAG,OAAO;KACX,CAAC,CAAC;IACH,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,IAAA,uBAAe,EAAC;QAC9D,IAAA,kBAAU,EAAC,OAAO,CAAC;QACnB,IAAA,gBAAQ,EAAC,OAAO,CAAC;KAClB,CAAC,CAAC;IACH,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC3C,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,2BAAmB,EACjE,OAAO,EACP,iDAAqC,CACtC,CAAC;IAEF,OAAO;QACL,IAAI;QACJ,cAAc,EAAE;YACd,GAAG,EAAE,YAAY;YACjB,GAAG,iBAAiB,EAAE;SACvB;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,WAAW;YAChB,GAAG,gBAAgB,EAAE;YACrB,KAAK,EAAE,cAAc;SACtB;QACD,SAAS,EAAE,YAAY;QACvB,gBAAgB;KACjB,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,UAAU,cAsCrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-tooltip';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./use-tooltip"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/use-tooltip/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface UseTooltipOptions {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useTooltip: (options?: UseTooltipOptions) => {
|
|
7
|
+
open: boolean;
|
|
8
|
+
referenceProps: {
|
|
9
|
+
ref: ((node: import("@floating-ui/react-dom").ReferenceType | null) => void) & ((node: import("@floating-ui/react").ReferenceType | null) => void);
|
|
10
|
+
};
|
|
11
|
+
contentProps: {
|
|
12
|
+
style: import("react").CSSProperties;
|
|
13
|
+
open: boolean;
|
|
14
|
+
ref: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
15
|
+
};
|
|
16
|
+
transitionStyles: import("react").CSSProperties;
|
|
17
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTooltip = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_2 = require("@floating-ui/react");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const useTooltip = (options) => {
|
|
8
|
+
const [open, setIsOpen] = (0, react_1.useState)(options?.open ?? false);
|
|
9
|
+
const { refs, floatingStyles, context } = (0, react_2.useFloating)({
|
|
10
|
+
whileElementsMounted: react_2.autoUpdate,
|
|
11
|
+
placement: "bottom",
|
|
12
|
+
transform: true,
|
|
13
|
+
open,
|
|
14
|
+
onOpenChange: options?.onOpenChange ?? setIsOpen,
|
|
15
|
+
strategy: "fixed",
|
|
16
|
+
middleware: constants_1.DEFAULT_MIDDLEWARE,
|
|
17
|
+
...options,
|
|
18
|
+
});
|
|
19
|
+
const { getReferenceProps, getFloatingProps } = (0, react_2.useInteractions)([
|
|
20
|
+
(0, react_2.useDismiss)(context),
|
|
21
|
+
(0, react_2.useClick)(context),
|
|
22
|
+
(0, react_2.useHover)(context),
|
|
23
|
+
]);
|
|
24
|
+
const { setReference, setFloating } = refs;
|
|
25
|
+
const { isMounted, styles: transitionStyles } = (0, react_2.useTransitionStyles)(context, constants_1.DROPDOWN_ANIMATION_IN_BOTTOM_POSITION);
|
|
26
|
+
return {
|
|
27
|
+
open,
|
|
28
|
+
referenceProps: {
|
|
29
|
+
ref: setReference,
|
|
30
|
+
...getReferenceProps,
|
|
31
|
+
},
|
|
32
|
+
contentProps: {
|
|
33
|
+
open: isMounted,
|
|
34
|
+
ref: setFloating,
|
|
35
|
+
...getFloatingProps,
|
|
36
|
+
style: floatingStyles,
|
|
37
|
+
},
|
|
38
|
+
transitionStyles,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.useTooltip = useTooltip;
|
|
42
|
+
//# sourceMappingURL=use-tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tooltip.js","sourceRoot":"","sources":["../../../../src/hooks/use-tooltip/use-tooltip.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,8CAQ4B;AAC5B,+CAGyB;AAOlB,MAAM,UAAU,GAAG,CAAC,OAA2B,EAAE,EAAE;IACxD,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,EAAE,IAAI,IAAI,KAAK,CAAC,CAAC;IAC3D,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAA,mBAAW,EAAC;QACpD,oBAAoB,EAAE,kBAAU;QAChC,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,IAAI;QACf,IAAI;QACJ,YAAY,EAAE,OAAO,EAAE,YAAY,IAAI,SAAS;QAChD,QAAQ,EAAE,OAAO;QACjB,UAAU,EAAE,8BAAkB;QAC9B,GAAG,OAAO;KACX,CAAC,CAAC;IACH,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,IAAA,uBAAe,EAAC;QAC9D,IAAA,kBAAU,EAAC,OAAO,CAAC;QACnB,IAAA,gBAAQ,EAAC,OAAO,CAAC;QACjB,IAAA,gBAAQ,EAAC,OAAO,CAAC;KAClB,CAAC,CAAC;IACH,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC3C,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,2BAAmB,EACjE,OAAO,EACP,iDAAqC,CACtC,CAAC;IAEF,OAAO;QACL,IAAI;QACJ,cAAc,EAAE;YACd,GAAG,EAAE,YAAY;YACjB,GAAG,iBAAiB;SACrB;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,WAAW;YAChB,GAAG,gBAAgB;YACnB,KAAK,EAAE,cAAc;SACtB;QACD,gBAAgB;KACjB,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,UAAU,cAqCrB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Chat, Message } from 'src/models';
|
|
2
|
+
export interface RefreshChatsSocketParams {
|
|
3
|
+
chatId: string;
|
|
4
|
+
}
|
|
5
|
+
export type JoinChatSocketParams = Chat;
|
|
6
|
+
export type CreateChatSocketParams = Chat;
|
|
7
|
+
export interface SendMessageSocketParams {
|
|
8
|
+
chat: Chat;
|
|
9
|
+
message: Message;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-socket-params.js","sourceRoot":"","sources":["../../../src/types/chat-socket-params.ts"],"names":[],"mappings":""}
|
package/build/src/types/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./custom-css-variables"), exports);
|
|
18
18
|
__exportStar(require("./extended-react-functional-component"), exports);
|
|
19
|
+
__exportStar(require("./chat-socket-params"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,wEAAsD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,wEAAsD;AACtD,uDAAqC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@circle-vibe/shared",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"types": "./build/index.d.ts",
|
|
5
5
|
"description": "Shared componenets, utils, hooks",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "./scripts/build.sh",
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
9
|
"publish": "./scripts/publish.sh",
|
|
10
|
-
"patch": "npm version patch"
|
|
10
|
+
"patch": "npm version patch",
|
|
11
|
+
"lint": "npx eslint src/**/*.ts --fix"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"build"
|
|
@@ -37,14 +38,18 @@
|
|
|
37
38
|
"@babel/preset-env": "^7.26.9",
|
|
38
39
|
"@babel/preset-react": "^7.26.3",
|
|
39
40
|
"@babel/preset-typescript": "^7.27.0",
|
|
41
|
+
"@eslint/js": "^9.26.0",
|
|
42
|
+
"@floating-ui/react": "^0.27.8",
|
|
40
43
|
"@types/node": "^16.18.96",
|
|
41
44
|
"@types/react": "^19.0.10",
|
|
42
45
|
"babel-loader": "^10.0.0",
|
|
43
46
|
"classnames": "^2.5.1",
|
|
44
47
|
"css-loader": "^7.1.2",
|
|
45
48
|
"date-fns": "^4.1.0",
|
|
49
|
+
"eslint": "^9.26.0",
|
|
46
50
|
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
47
51
|
"formik": "^2.4.6",
|
|
52
|
+
"globals": "^16.0.0",
|
|
48
53
|
"react": "^18.2.0",
|
|
49
54
|
"sass": "^1.85.1",
|
|
50
55
|
"sass-loader": "^16.0.5",
|
|
@@ -52,6 +57,7 @@
|
|
|
52
57
|
"terser-webpack-plugin": "^5.3.14",
|
|
53
58
|
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
54
59
|
"typescript": "^4.9.5",
|
|
60
|
+
"typescript-eslint": "^8.31.1",
|
|
55
61
|
"webpack": "^5.91.0",
|
|
56
62
|
"webpack-cli": "^5.1.4",
|
|
57
63
|
"yup": "^1.6.1"
|