@machinerd/js-module 0.8.0 → 0.8.1
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/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.cts +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks-CUj2xuzU.cjs +1 -0
- package/dist/hooks-gbU5dqVF.mjs +1 -0
- package/dist/{index-B11XDBo5.d.cts → index-BFHrNSKP.d.mts} +3 -3
- package/dist/{index-dbBlRf5k.d.mts → index-DiRj3rRA.d.cts} +3 -3
- package/dist/providers/index.d.cts +2 -2
- package/dist/ui/carousel/index.d.cts +9 -9
- package/dist/ui/carousel/index.d.mts +9 -9
- package/dist/ui/dialog/index.cjs +1 -1
- package/dist/ui/dialog/index.d.cts +2 -2
- package/dist/ui/dialog/index.mjs +1 -1
- package/dist/ui/image/index.d.cts +6 -6
- package/dist/ui/image/index.d.mts +8 -8
- package/dist/ui/index.d.cts +17 -17
- package/dist/ui/index.d.mts +17 -17
- package/dist/ui/sheet/index.cjs +1 -1
- package/dist/ui/sheet/index.d.cts +2 -2
- package/dist/ui/sheet/index.mjs +1 -1
- package/dist/ui/tooltip/index.cjs +1 -1
- package/dist/ui/tooltip/index.d.cts +2 -2
- package/dist/ui/tooltip/index.mjs +1 -1
- package/dist/util/common.d.cts +1 -1
- package/dist/util/common.d.mts +1 -1
- package/package.json +1 -1
- package/dist/hooks--O5RcEJq.cjs +0 -1
- package/dist/hooks-C9rXWkfW.mjs +0 -1
package/dist/hooks/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../src-CjpmdVyv.cjs`),require(`../file-5mweNdAM.cjs`);const e=require(`../hooks
|
|
1
|
+
require(`../src-CjpmdVyv.cjs`),require(`../file-5mweNdAM.cjs`);const e=require(`../hooks-CUj2xuzU.cjs`);require(`../providers-CkXkdYcB.cjs`);const t=require(`../use-subset-image-DC86cg6O.cjs`);exports.SUBSETS=t.t,exports.useDelayUnmount=e.o,exports.useDragScroll=e.a,exports.useOutsideClick=e.i,exports.useScrollLock=e.r,exports.useScrollTop=e.n,exports.useSubsetImage=t.n,exports.useWindowSize=e.t;
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as UseSubsetImageProps, c as useScrollTop, d as UseOutsideClickProps, f as useOutsideClick, i as SUBSETS, l as UseScrollLockProps, m as useDelayUnmount, n as BaseProps, o as useSubsetImage, p as useDragScroll, r as Folder, s as UseScrollTopProps, t as useWindowSize, u as useScrollLock } from "../index-
|
|
1
|
+
import { a as UseSubsetImageProps, c as useScrollTop, d as UseOutsideClickProps, f as useOutsideClick, i as SUBSETS, l as UseScrollLockProps, m as useDelayUnmount, n as BaseProps, o as useSubsetImage, p as useDragScroll, r as Folder, s as UseScrollTopProps, t as useWindowSize, u as useScrollLock } from "../index-DiRj3rRA.cjs";
|
|
2
2
|
export { BaseProps, Folder, SUBSETS, UseOutsideClickProps, UseScrollLockProps, UseScrollTopProps, UseSubsetImageProps, useDelayUnmount, useDragScroll, useOutsideClick, useScrollLock, useScrollTop, useSubsetImage, useWindowSize };
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as UseSubsetImageProps, c as useScrollTop, d as UseOutsideClickProps, f as useOutsideClick, i as SUBSETS, l as UseScrollLockProps, m as useDelayUnmount, n as BaseProps, o as useSubsetImage, p as useDragScroll, r as Folder, s as UseScrollTopProps, t as useWindowSize, u as useScrollLock } from "../index-
|
|
1
|
+
import { a as UseSubsetImageProps, c as useScrollTop, d as UseOutsideClickProps, f as useOutsideClick, i as SUBSETS, l as UseScrollLockProps, m as useDelayUnmount, n as BaseProps, o as useSubsetImage, p as useDragScroll, r as Folder, s as UseScrollTopProps, t as useWindowSize, u as useScrollLock } from "../index-BFHrNSKP.mjs";
|
|
2
2
|
export { BaseProps, Folder, SUBSETS, UseOutsideClickProps, UseScrollLockProps, UseScrollTopProps, UseSubsetImageProps, useDelayUnmount, useDragScroll, useOutsideClick, useScrollLock, useScrollTop, useSubsetImage, useWindowSize };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../src-CukOR3K2.mjs";import"../file-DShNxIW4.mjs";import{a as e,i as t,n,o as r,r as i,t as a}from"../hooks-
|
|
1
|
+
import"../src-CukOR3K2.mjs";import"../file-DShNxIW4.mjs";import{a as e,i as t,n,o as r,r as i,t as a}from"../hooks-gbU5dqVF.mjs";import"../providers-zftmvT1z.mjs";import{n as o,t as s}from"../use-subset-image-D8ssrZhj.mjs";export{s as SUBSETS,r as useDelayUnmount,e as useDragScroll,t as useOutsideClick,i as useScrollLock,n as useScrollTop,o as useSubsetImage,a as useWindowSize};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`lodash-es`),n=require(`react`);function r(e,t){let[r,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{if(e){i(!0);return}let n=setTimeout(()=>i(!1),t);return()=>clearTimeout(n)},[e,t]),e||r}function i(e=1){let t=(0,n.useRef)(null),[r,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(0),[s,c]=(0,n.useState)(0),l=(0,n.useRef)(!1);return{ref:t,onMouseDown:e=>{t.current&&(i(!0),l.current=!1,o(e.pageX-t.current.offsetLeft),c(t.current.scrollLeft))},onMouseLeave:()=>i(!1),onMouseUp:()=>i(!1),onMouseMove:n=>{if(!r||!t.current)return;n.preventDefault();let i=(n.pageX-t.current.offsetLeft-a)*e;Math.abs(i)>10&&(l.current=!0),t.current.scrollLeft=s-i},onClickCapture:e=>{l.current&&(e.stopPropagation(),e.preventDefault())}}}function a({ref:e,setOpen:t}){let r=(0,n.useCallback)(n=>{e.current?.contains(n.target)||t(!1)},[e,t]);(0,n.useEffect)(()=>(document.addEventListener(`mousedown`,r),document.addEventListener(`touchstart`,r),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`touchstart`,r)}),[r])}const o=[`mouse`,`touch`];function s({open:e,type:t=o}){let r=(0,n.useCallback)(e=>{e.preventDefault()},[]),i=(0,n.useCallback)(e=>{e.preventDefault()},[]);(0,n.useEffect)(()=>{let n=e&&t.includes(`mouse`),a=e&&t.includes(`touch`);return n?(document.body.classList.add(`overflow-hidden`),document.addEventListener(`wheel`,i,{passive:!1})):(document.body.classList.remove(`overflow-hidden`),document.removeEventListener(`wheel`,i)),a?document.addEventListener(`touchmove`,r,{passive:!1}):document.removeEventListener(`touchmove`,r),()=>{document.body.classList.remove(`overflow-hidden`),document.removeEventListener(`touchmove`,r),document.removeEventListener(`wheel`,i)}},[e,t,r,i])}function c({enabled:e=!0,behavior:t=`smooth`}={}){let[r,i]=(0,n.useState)(!1),a=(0,n.useRef)(null),o=(0,n.useCallback)(()=>{window.scrollTo({top:0,behavior:t})},[t]);return(0,n.useEffect)(()=>{let t=a.current;if(!t||!e){i(!1);return}let n=new IntersectionObserver(e=>{let t=e[0];t&&i(!t.isIntersecting)},{root:null,rootMargin:`0px`,threshold:0});return n.observe(t),()=>n.disconnect()},[e]),{isVisible:r,handleScrolToTop:o,ref:a}}function l(e=1280){let[r,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let e=(0,t.throttle)(()=>{let e=window.innerWidth;i(e)},200);return window.addEventListener(`resize`,e),e(),()=>window.removeEventListener(`resize`,e)},[]),{windowSize:r}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{throttle as e}from"lodash-es";import{useCallback as t,useEffect as n,useRef as r,useState as i}from"react";function a(e,t){let[r,a]=i(e);return n(()=>{if(e){a(!0);return}let n=setTimeout(()=>a(!1),t);return()=>clearTimeout(n)},[e,t]),e||r}function o(e=1){let t=r(null),[n,a]=i(!1),[o,s]=i(0),[c,l]=i(0),u=r(!1);return{ref:t,onMouseDown:e=>{t.current&&(a(!0),u.current=!1,s(e.pageX-t.current.offsetLeft),l(t.current.scrollLeft))},onMouseLeave:()=>a(!1),onMouseUp:()=>a(!1),onMouseMove:r=>{if(!n||!t.current)return;r.preventDefault();let i=(r.pageX-t.current.offsetLeft-o)*e;Math.abs(i)>10&&(u.current=!0),t.current.scrollLeft=c-i},onClickCapture:e=>{u.current&&(e.stopPropagation(),e.preventDefault())}}}function s({ref:e,setOpen:r}){let i=t(t=>{e.current?.contains(t.target)||r(!1)},[e,r]);n(()=>(document.addEventListener(`mousedown`,i),document.addEventListener(`touchstart`,i),()=>{document.removeEventListener(`mousedown`,i),document.removeEventListener(`touchstart`,i)}),[i])}const c=[`mouse`,`touch`];function l({open:e,type:r=c}){let i=t(e=>{e.preventDefault()},[]),a=t(e=>{e.preventDefault()},[]);n(()=>{let t=e&&r.includes(`mouse`),n=e&&r.includes(`touch`);return t?(document.body.classList.add(`overflow-hidden`),document.addEventListener(`wheel`,a,{passive:!1})):(document.body.classList.remove(`overflow-hidden`),document.removeEventListener(`wheel`,a)),n?document.addEventListener(`touchmove`,i,{passive:!1}):document.removeEventListener(`touchmove`,i),()=>{document.body.classList.remove(`overflow-hidden`),document.removeEventListener(`touchmove`,i),document.removeEventListener(`wheel`,a)}},[e,r,i,a])}function u({enabled:e=!0,behavior:a=`smooth`}={}){let[o,s]=i(!1),c=r(null),l=t(()=>{window.scrollTo({top:0,behavior:a})},[a]);return n(()=>{let t=c.current;if(!t||!e){s(!1);return}let n=new IntersectionObserver(e=>{let t=e[0];t&&s(!t.isIntersecting)},{root:null,rootMargin:`0px`,threshold:0});return n.observe(t),()=>n.disconnect()},[e]),{isVisible:o,handleScrolToTop:l,ref:c}}function d(t=1280){let[r,a]=i(t);return n(()=>{let t=e(()=>{let e=window.innerWidth;a(e)},200);return window.addEventListener(`resize`,t),t(),()=>window.removeEventListener(`resize`,t)},[]),{windowSize:r}}export{o as a,s as i,u as n,a as o,l as r,d as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react2 from "react";
|
|
2
2
|
import React$1, { Dispatch, RefObject, SetStateAction } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/hooks/use-delay-unmount.d.ts
|
|
@@ -6,7 +6,7 @@ declare function useDelayUnmount(isMounted: boolean, delayTime: number): boolean
|
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/hooks/use-drag-scroll.d.ts
|
|
8
8
|
declare function useDragScroll(speed?: number): {
|
|
9
|
-
ref:
|
|
9
|
+
ref: react2.RefObject<HTMLDivElement>;
|
|
10
10
|
onMouseDown: (e: React.MouseEvent) => void;
|
|
11
11
|
onMouseLeave: () => void;
|
|
12
12
|
onMouseUp: () => void;
|
|
@@ -46,7 +46,7 @@ declare function useScrollTop({
|
|
|
46
46
|
}?: UseScrollTopProps): {
|
|
47
47
|
isVisible: boolean;
|
|
48
48
|
handleScrolToTop: () => void;
|
|
49
|
-
ref:
|
|
49
|
+
ref: react2.RefObject<HTMLDivElement>;
|
|
50
50
|
};
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/hooks/use-subset-image.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react5 from "react";
|
|
2
2
|
import React$1, { Dispatch, RefObject, SetStateAction } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/hooks/use-delay-unmount.d.ts
|
|
@@ -6,7 +6,7 @@ declare function useDelayUnmount(isMounted: boolean, delayTime: number): boolean
|
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/hooks/use-drag-scroll.d.ts
|
|
8
8
|
declare function useDragScroll(speed?: number): {
|
|
9
|
-
ref:
|
|
9
|
+
ref: react5.RefObject<HTMLDivElement>;
|
|
10
10
|
onMouseDown: (e: React.MouseEvent) => void;
|
|
11
11
|
onMouseLeave: () => void;
|
|
12
12
|
onMouseUp: () => void;
|
|
@@ -46,7 +46,7 @@ declare function useScrollTop({
|
|
|
46
46
|
}?: UseScrollTopProps): {
|
|
47
47
|
isVisible: boolean;
|
|
48
48
|
handleScrolToTop: () => void;
|
|
49
|
-
ref:
|
|
49
|
+
ref: react5.RefObject<HTMLDivElement>;
|
|
50
50
|
};
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/hooks/use-subset-image.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ApiConfig, t as ApiClient } from "../index-CeiAF-WU.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/providers/api-client/api-client.d.ts
|
|
5
5
|
declare function ApiClientProvider({
|
|
@@ -8,7 +8,7 @@ declare function ApiClientProvider({
|
|
|
8
8
|
}: {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
config: ApiConfig;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime12.JSX.Element;
|
|
12
12
|
declare function useApiClient(): ApiClient;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { ApiClientProvider, useApiClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ComponentProps } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
4
4
|
|
|
5
5
|
//#region src/ui/carousel/carousel-context.d.ts
|
|
@@ -41,40 +41,40 @@ declare function Carousel({
|
|
|
41
41
|
className,
|
|
42
42
|
children,
|
|
43
43
|
...props
|
|
44
|
-
}: CarouselProps$1):
|
|
44
|
+
}: CarouselProps$1): react_jsx_runtime1.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/ui/carousel/carousel-viewport.d.ts
|
|
47
47
|
declare function CarouselViewport({
|
|
48
48
|
children,
|
|
49
49
|
className,
|
|
50
50
|
...props
|
|
51
|
-
}: React.ComponentProps<'div'>):
|
|
51
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/ui/carousel/carousel-wrapper.d.ts
|
|
54
54
|
declare function CarouselWrapper({
|
|
55
55
|
className,
|
|
56
56
|
...props
|
|
57
|
-
}: React.ComponentProps<'div'>):
|
|
57
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/ui/carousel/carousel-item.d.ts
|
|
60
60
|
declare function CarouselItem({
|
|
61
61
|
className,
|
|
62
62
|
...props
|
|
63
|
-
}: React.ComponentProps<'div'>):
|
|
63
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/ui/carousel/carousel-previous.d.ts
|
|
66
66
|
declare function CarouselPrevious({
|
|
67
67
|
children,
|
|
68
68
|
className,
|
|
69
69
|
...props
|
|
70
|
-
}: React.ComponentProps<'button'>):
|
|
70
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime1.JSX.Element;
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/ui/carousel/carousel-next.d.ts
|
|
73
73
|
declare function CarouselNext({
|
|
74
74
|
children,
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'button'>):
|
|
77
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime1.JSX.Element;
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/ui/carousel/carousel-dots.d.ts
|
|
80
80
|
declare function CarouselDots$1({
|
|
@@ -82,7 +82,7 @@ declare function CarouselDots$1({
|
|
|
82
82
|
...props
|
|
83
83
|
}: Omit<React.ComponentProps<'button'>, 'children'> & {
|
|
84
84
|
children?: (index: number) => React.ReactNode;
|
|
85
|
-
}):
|
|
85
|
+
}): react_jsx_runtime1.JSX.Element;
|
|
86
86
|
//#endregion
|
|
87
87
|
//#region src/ui/carousel/carousel-dot.d.ts
|
|
88
88
|
declare function CarouselDots({
|
|
@@ -91,6 +91,6 @@ declare function CarouselDots({
|
|
|
91
91
|
...props
|
|
92
92
|
}: React.ComponentProps<'button'> & {
|
|
93
93
|
index: number;
|
|
94
|
-
}):
|
|
94
|
+
}): react_jsx_runtime1.JSX.Element;
|
|
95
95
|
//#endregion
|
|
96
96
|
export { Carousel, type CarouselApi, type CarouselContextProps, CarouselDots as CarouselDot, CarouselDots$1 as CarouselDots, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselViewport, CarouselWrapper, useCarousel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ComponentProps } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
4
4
|
|
|
5
5
|
//#region src/ui/carousel/carousel-context.d.ts
|
|
@@ -41,40 +41,40 @@ declare function Carousel({
|
|
|
41
41
|
className,
|
|
42
42
|
children,
|
|
43
43
|
...props
|
|
44
|
-
}: CarouselProps$1):
|
|
44
|
+
}: CarouselProps$1): react_jsx_runtime2.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/ui/carousel/carousel-viewport.d.ts
|
|
47
47
|
declare function CarouselViewport({
|
|
48
48
|
children,
|
|
49
49
|
className,
|
|
50
50
|
...props
|
|
51
|
-
}: React.ComponentProps<'div'>):
|
|
51
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/ui/carousel/carousel-wrapper.d.ts
|
|
54
54
|
declare function CarouselWrapper({
|
|
55
55
|
className,
|
|
56
56
|
...props
|
|
57
|
-
}: React.ComponentProps<'div'>):
|
|
57
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/ui/carousel/carousel-item.d.ts
|
|
60
60
|
declare function CarouselItem({
|
|
61
61
|
className,
|
|
62
62
|
...props
|
|
63
|
-
}: React.ComponentProps<'div'>):
|
|
63
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/ui/carousel/carousel-previous.d.ts
|
|
66
66
|
declare function CarouselPrevious({
|
|
67
67
|
children,
|
|
68
68
|
className,
|
|
69
69
|
...props
|
|
70
|
-
}: React.ComponentProps<'button'>):
|
|
70
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime2.JSX.Element;
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/ui/carousel/carousel-next.d.ts
|
|
73
73
|
declare function CarouselNext({
|
|
74
74
|
children,
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'button'>):
|
|
77
|
+
}: React.ComponentProps<'button'>): react_jsx_runtime2.JSX.Element;
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/ui/carousel/carousel-dots.d.ts
|
|
80
80
|
declare function CarouselDots$1({
|
|
@@ -82,7 +82,7 @@ declare function CarouselDots$1({
|
|
|
82
82
|
...props
|
|
83
83
|
}: Omit<React.ComponentProps<'button'>, 'children'> & {
|
|
84
84
|
children?: (index: number) => React.ReactNode;
|
|
85
|
-
}):
|
|
85
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
86
86
|
//#endregion
|
|
87
87
|
//#region src/ui/carousel/carousel-dot.d.ts
|
|
88
88
|
declare function CarouselDots({
|
|
@@ -91,6 +91,6 @@ declare function CarouselDots({
|
|
|
91
91
|
...props
|
|
92
92
|
}: React.ComponentProps<'button'> & {
|
|
93
93
|
index: number;
|
|
94
|
-
}):
|
|
94
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
95
95
|
//#endregion
|
|
96
96
|
export { Carousel, type CarouselApi, type CarouselContextProps, CarouselDots as CarouselDot, CarouselDots$1 as CarouselDots, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselViewport, CarouselWrapper, useCarousel };
|
package/dist/ui/dialog/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../hooks
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../hooks-CUj2xuzU.cjs`);require(`../../providers-CkXkdYcB.cjs`),require(`../../use-subset-image-DC86cg6O.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`class-variance-authority`);const a=(0,i.cva)(`komc:relative komc:z-10 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden komc:w-full komc:max-h-full komc:min-w-0 komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function o({closeOnBackdropClick:e=!0,isOpen:i,zIndex:o=1e4,padding:s,maxWidth:c,className:l,onClose:u,children:d,...f}){let p=t.o(i,300),[m,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(i&&p){let e=setTimeout(()=>h(!0),10);return()=>clearTimeout(e)}else i||h(!1)},[i,p]);let g=(0,n.useCallback)(e=>{e.key===`Escape`&&u()},[u]),_=(0,n.useCallback)(()=>{e&&u()},[e,u]);return(0,n.useEffect)(()=>(i?(document.addEventListener(`keydown`,g),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,g),document.body.style.overflow=`unset`}),[i,g]),p?(0,r.jsx)(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden`,style:{zIndex:o},children:(0,r.jsxs)(`div`,{className:`komc:relative komc:flex komc:min-h-0 komc:flex-1 komc:w-full komc:items-center komc:justify-center`,children:[(0,r.jsx)(`button`,{type:`button`,"data-state":m?`open`:`closed`,className:`komc:fixed komc:inset-0 komc:z-0 komc:cursor-default komc:bg-black/50 komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:_,"aria-label":`close dialog`}),(0,r.jsx)(`div`,{"data-state":m?`open`:`closed`,className:`${a({padding:s,maxWidth:c,className:l})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...f,children:d})]})}):null}exports.Dialog=o;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
3
3
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
|
|
@@ -25,6 +25,6 @@ declare function Dialog({
|
|
|
25
25
|
onClose,
|
|
26
26
|
children,
|
|
27
27
|
...rest
|
|
28
|
-
}: DialogProps):
|
|
28
|
+
}: DialogProps): react_jsx_runtime9.JSX.Element | null;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { Dialog, type DialogProps };
|
package/dist/ui/dialog/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"../../src-CukOR3K2.mjs";import"../../file-DShNxIW4.mjs";import{o as e}from"../../hooks-
|
|
1
|
+
"use client";import"../../src-CukOR3K2.mjs";import"../../file-DShNxIW4.mjs";import{o as e}from"../../hooks-gbU5dqVF.mjs";import"../../providers-zftmvT1z.mjs";import"../../use-subset-image-D8ssrZhj.mjs";import{useCallback as t,useEffect as n,useState as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";const s=o(`komc:relative komc:z-10 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden komc:w-full komc:max-h-full komc:min-w-0 komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function c({closeOnBackdropClick:o=!0,isOpen:c,zIndex:l=1e4,padding:u,maxWidth:d,className:f,onClose:p,children:m,...h}){let g=e(c,300),[_,v]=r(!1);n(()=>{if(c&&g){let e=setTimeout(()=>v(!0),10);return()=>clearTimeout(e)}else c||v(!1)},[c,g]);let y=t(e=>{e.key===`Escape`&&p()},[p]),b=t(()=>{o&&p()},[o,p]);return n(()=>(c?(document.addEventListener(`keydown`,y),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,y),document.body.style.overflow=`unset`}),[c,y]),g?i(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden`,style:{zIndex:l},children:a(`div`,{className:`komc:relative komc:flex komc:min-h-0 komc:flex-1 komc:w-full komc:items-center komc:justify-center`,children:[i(`button`,{type:`button`,"data-state":_?`open`:`closed`,className:`komc:fixed komc:inset-0 komc:z-0 komc:cursor-default komc:bg-black/50 komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:b,"aria-label":`close dialog`}),i(`div`,{"data-state":_?`open`:`closed`,className:`${s({padding:u,maxWidth:d,className:f})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...h,children:m})]})}):null}export{c as Dialog};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as UseSubsetImageProps, n as BaseProps } from "../../index-
|
|
2
|
-
import * as
|
|
1
|
+
import { a as UseSubsetImageProps, n as BaseProps } from "../../index-DiRj3rRA.cjs";
|
|
2
|
+
import * as react1 from "react";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/ui/image/image.d.ts
|
|
@@ -11,7 +11,7 @@ interface ImageSubsetProps {
|
|
|
11
11
|
skeletonClassName?: string;
|
|
12
12
|
}
|
|
13
13
|
type ImageProps = UseSubsetImageProps & ImageSubsetProps;
|
|
14
|
-
declare const BaseImage:
|
|
14
|
+
declare const BaseImage: react1.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
15
15
|
fill: true;
|
|
16
16
|
sizes: string;
|
|
17
17
|
width?: never;
|
|
@@ -21,8 +21,8 @@ declare const BaseImage: react0.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
|
21
21
|
sizes?: never;
|
|
22
22
|
width: number;
|
|
23
23
|
height: number;
|
|
24
|
-
}, "ref">) &
|
|
25
|
-
declare const Image:
|
|
24
|
+
}, "ref">) & react1.RefAttributes<HTMLImageElement>>;
|
|
25
|
+
declare const Image: react1.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
26
26
|
fill: true;
|
|
27
27
|
sizes: string;
|
|
28
28
|
width?: never;
|
|
@@ -32,7 +32,7 @@ declare const Image: react0.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
|
32
32
|
sizes?: never;
|
|
33
33
|
width: number;
|
|
34
34
|
height: number;
|
|
35
|
-
} & ImageSubsetProps, "ref">) &
|
|
35
|
+
} & ImageSubsetProps, "ref">) & react1.RefAttributes<HTMLImageElement>>;
|
|
36
36
|
interface EmptyNodeProps {
|
|
37
37
|
children: React.ReactNode;
|
|
38
38
|
className?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as UseSubsetImageProps, n as BaseProps } from "../../index-
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
1
|
+
import { a as UseSubsetImageProps, n as BaseProps } from "../../index-BFHrNSKP.mjs";
|
|
2
|
+
import * as react3 from "react";
|
|
3
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/ui/image/image.d.ts
|
|
6
6
|
interface ImageSubsetProps {
|
|
@@ -11,7 +11,7 @@ interface ImageSubsetProps {
|
|
|
11
11
|
skeletonClassName?: string;
|
|
12
12
|
}
|
|
13
13
|
type ImageProps = UseSubsetImageProps & ImageSubsetProps;
|
|
14
|
-
declare const BaseImage:
|
|
14
|
+
declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
15
15
|
fill: true;
|
|
16
16
|
sizes: string;
|
|
17
17
|
width?: never;
|
|
@@ -21,8 +21,8 @@ declare const BaseImage: react2.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
|
21
21
|
sizes?: never;
|
|
22
22
|
width: number;
|
|
23
23
|
height: number;
|
|
24
|
-
}, "ref">) &
|
|
25
|
-
declare const Image:
|
|
24
|
+
}, "ref">) & react3.RefAttributes<HTMLImageElement>>;
|
|
25
|
+
declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
26
26
|
fill: true;
|
|
27
27
|
sizes: string;
|
|
28
28
|
width?: never;
|
|
@@ -32,7 +32,7 @@ declare const Image: react2.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
|
32
32
|
sizes?: never;
|
|
33
33
|
width: number;
|
|
34
34
|
height: number;
|
|
35
|
-
} & ImageSubsetProps, "ref">) &
|
|
35
|
+
} & ImageSubsetProps, "ref">) & react3.RefAttributes<HTMLImageElement>>;
|
|
36
36
|
interface EmptyNodeProps {
|
|
37
37
|
children: React.ReactNode;
|
|
38
38
|
className?: string;
|
|
@@ -40,6 +40,6 @@ interface EmptyNodeProps {
|
|
|
40
40
|
declare const EmptyNode: ({
|
|
41
41
|
children,
|
|
42
42
|
className
|
|
43
|
-
}: EmptyNodeProps) =>
|
|
43
|
+
}: EmptyNodeProps) => react_jsx_runtime9.JSX.Element;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { BaseImage, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps };
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react11 from "react";
|
|
2
2
|
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
4
|
+
import * as class_variance_authority_types2 from "class-variance-authority/types";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
6
|
|
|
7
7
|
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
@@ -18,13 +18,13 @@ declare function BottomAppBar<T>({
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/ui/button/button.d.ts
|
|
20
20
|
declare const classes$2: (props?: ({
|
|
21
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
21
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "xxs" | "4xl" | null | undefined;
|
|
22
22
|
shadow?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "3xl" | null | undefined;
|
|
23
23
|
outline?: "line" | "solid" | "clear" | null | undefined;
|
|
24
24
|
variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
|
|
25
25
|
px?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
26
26
|
rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
27
|
-
} &
|
|
27
|
+
} & class_variance_authority_types2.ClassProp) | undefined) => string;
|
|
28
28
|
interface VariantMap {
|
|
29
29
|
line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
|
|
30
30
|
solid: 'white' | 'gray' | 'blue' | 'night' | 'black' | 'sky' | 'sky-blue' | 'indigo';
|
|
@@ -43,22 +43,22 @@ type ButtonProps = ComponentProps<'button'> & BaseProps & ({
|
|
|
43
43
|
}) & {
|
|
44
44
|
asChild?: boolean;
|
|
45
45
|
};
|
|
46
|
-
declare const Button:
|
|
46
|
+
declare const Button: react11.ForwardRefExoticComponent<(Omit<react11.ClassAttributes<HTMLButtonElement> & react11.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
47
47
|
outline?: "line";
|
|
48
48
|
variant?: VariantMap["line"];
|
|
49
49
|
} & {
|
|
50
50
|
asChild?: boolean;
|
|
51
|
-
}, "ref"> | Omit<
|
|
51
|
+
}, "ref"> | Omit<react11.ClassAttributes<HTMLButtonElement> & react11.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
52
52
|
outline: "solid";
|
|
53
53
|
variant?: VariantMap["solid"];
|
|
54
54
|
} & {
|
|
55
55
|
asChild?: boolean;
|
|
56
|
-
}, "ref"> | Omit<
|
|
56
|
+
}, "ref"> | Omit<react11.ClassAttributes<HTMLButtonElement> & react11.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
57
57
|
outline: "clear";
|
|
58
58
|
variant?: VariantMap["clear"];
|
|
59
59
|
} & {
|
|
60
60
|
asChild?: boolean;
|
|
61
|
-
}, "ref">) &
|
|
61
|
+
}, "ref">) & react11.RefAttributes<HTMLButtonElement>>;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
64
64
|
interface ConditionalWrapperProps {
|
|
@@ -70,7 +70,7 @@ declare function ConditionalWrapper({
|
|
|
70
70
|
condition,
|
|
71
71
|
wrapper,
|
|
72
72
|
children
|
|
73
|
-
}: ConditionalWrapperProps):
|
|
73
|
+
}: ConditionalWrapperProps): react11.ReactNode;
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/ui/conditional-wrapper/conditional-either-wrapper.d.ts
|
|
76
76
|
interface ConditionalEitherWrapperProps {
|
|
@@ -84,15 +84,15 @@ declare function ConditionalEitherWrapper({
|
|
|
84
84
|
trueWrapper,
|
|
85
85
|
falseWrapper,
|
|
86
86
|
children
|
|
87
|
-
}: ConditionalEitherWrapperProps):
|
|
87
|
+
}: ConditionalEitherWrapperProps): react11.ReactNode;
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/ui/input/input.d.ts
|
|
90
90
|
declare const classes$1: (props?: ({
|
|
91
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
91
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "base" | "3xl" | null | undefined;
|
|
92
92
|
gap?: "sm" | "md" | "lg" | "none" | "xl" | "xs" | null | undefined;
|
|
93
93
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
94
94
|
rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | null | undefined;
|
|
95
|
-
} &
|
|
95
|
+
} & class_variance_authority_types2.ClassProp) | undefined) => string;
|
|
96
96
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
|
|
97
97
|
size?: VariantProps<typeof classes$1>['size'];
|
|
98
98
|
gap?: VariantProps<typeof classes$1>['gap'];
|
|
@@ -101,13 +101,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
101
101
|
prefix?: React.ReactNode;
|
|
102
102
|
surffix?: React.ReactNode;
|
|
103
103
|
}
|
|
104
|
-
declare const Input:
|
|
104
|
+
declare const Input: react11.ForwardRefExoticComponent<InputProps & react11.RefAttributes<HTMLInputElement>>;
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
107
107
|
declare const classes: (props?: ({
|
|
108
108
|
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
|
|
109
109
|
rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
110
|
-
} &
|
|
110
|
+
} & class_variance_authority_types2.ClassProp) | undefined) => string;
|
|
111
111
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
112
112
|
width?: string | number;
|
|
113
113
|
height?: string | number;
|
|
@@ -121,7 +121,7 @@ declare function Skeleton({
|
|
|
121
121
|
height,
|
|
122
122
|
className,
|
|
123
123
|
...props
|
|
124
|
-
}: SkeletonProps):
|
|
124
|
+
}: SkeletonProps): react_jsx_runtime11.JSX.Element;
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/ui/stable-text/stable-text.d.ts
|
|
127
127
|
declare function StableText({
|
|
@@ -130,6 +130,6 @@ declare function StableText({
|
|
|
130
130
|
...props
|
|
131
131
|
}: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
132
132
|
children: string | number;
|
|
133
|
-
}):
|
|
133
|
+
}): react_jsx_runtime11.JSX.Element;
|
|
134
134
|
//#endregion
|
|
135
135
|
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalEitherWrapper, type ConditionalEitherWrapperProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react11 from "react";
|
|
2
2
|
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
|
-
import * as
|
|
5
|
+
import * as class_variance_authority_types2 from "class-variance-authority/types";
|
|
6
6
|
|
|
7
7
|
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
8
8
|
interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
|
|
@@ -18,13 +18,13 @@ declare function BottomAppBar<T>({
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/ui/button/button.d.ts
|
|
20
20
|
declare const classes$2: (props?: ({
|
|
21
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
21
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "xxs" | "4xl" | null | undefined;
|
|
22
22
|
shadow?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "3xl" | null | undefined;
|
|
23
23
|
outline?: "line" | "solid" | "clear" | null | undefined;
|
|
24
24
|
variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
|
|
25
25
|
px?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
26
26
|
rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
27
|
-
} &
|
|
27
|
+
} & class_variance_authority_types2.ClassProp) | undefined) => string;
|
|
28
28
|
interface VariantMap {
|
|
29
29
|
line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
|
|
30
30
|
solid: 'white' | 'gray' | 'blue' | 'night' | 'black' | 'sky' | 'sky-blue' | 'indigo';
|
|
@@ -43,22 +43,22 @@ type ButtonProps = ComponentProps<'button'> & BaseProps & ({
|
|
|
43
43
|
}) & {
|
|
44
44
|
asChild?: boolean;
|
|
45
45
|
};
|
|
46
|
-
declare const Button:
|
|
46
|
+
declare const Button: react11.ForwardRefExoticComponent<(Omit<react11.ClassAttributes<HTMLButtonElement> & react11.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
47
47
|
outline?: "line";
|
|
48
48
|
variant?: VariantMap["line"];
|
|
49
49
|
} & {
|
|
50
50
|
asChild?: boolean;
|
|
51
|
-
}, "ref"> | Omit<
|
|
51
|
+
}, "ref"> | Omit<react11.ClassAttributes<HTMLButtonElement> & react11.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
52
52
|
outline: "solid";
|
|
53
53
|
variant?: VariantMap["solid"];
|
|
54
54
|
} & {
|
|
55
55
|
asChild?: boolean;
|
|
56
|
-
}, "ref"> | Omit<
|
|
56
|
+
}, "ref"> | Omit<react11.ClassAttributes<HTMLButtonElement> & react11.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
57
57
|
outline: "clear";
|
|
58
58
|
variant?: VariantMap["clear"];
|
|
59
59
|
} & {
|
|
60
60
|
asChild?: boolean;
|
|
61
|
-
}, "ref">) &
|
|
61
|
+
}, "ref">) & react11.RefAttributes<HTMLButtonElement>>;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
64
64
|
interface ConditionalWrapperProps {
|
|
@@ -70,7 +70,7 @@ declare function ConditionalWrapper({
|
|
|
70
70
|
condition,
|
|
71
71
|
wrapper,
|
|
72
72
|
children
|
|
73
|
-
}: ConditionalWrapperProps):
|
|
73
|
+
}: ConditionalWrapperProps): react11.ReactNode;
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/ui/conditional-wrapper/conditional-either-wrapper.d.ts
|
|
76
76
|
interface ConditionalEitherWrapperProps {
|
|
@@ -84,15 +84,15 @@ declare function ConditionalEitherWrapper({
|
|
|
84
84
|
trueWrapper,
|
|
85
85
|
falseWrapper,
|
|
86
86
|
children
|
|
87
|
-
}: ConditionalEitherWrapperProps):
|
|
87
|
+
}: ConditionalEitherWrapperProps): react11.ReactNode;
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/ui/input/input.d.ts
|
|
90
90
|
declare const classes$1: (props?: ({
|
|
91
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
91
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "base" | "3xl" | null | undefined;
|
|
92
92
|
gap?: "sm" | "md" | "lg" | "none" | "xl" | "xs" | null | undefined;
|
|
93
93
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
94
94
|
rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | null | undefined;
|
|
95
|
-
} &
|
|
95
|
+
} & class_variance_authority_types2.ClassProp) | undefined) => string;
|
|
96
96
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
|
|
97
97
|
size?: VariantProps<typeof classes$1>['size'];
|
|
98
98
|
gap?: VariantProps<typeof classes$1>['gap'];
|
|
@@ -101,13 +101,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
101
101
|
prefix?: React.ReactNode;
|
|
102
102
|
surffix?: React.ReactNode;
|
|
103
103
|
}
|
|
104
|
-
declare const Input:
|
|
104
|
+
declare const Input: react11.ForwardRefExoticComponent<InputProps & react11.RefAttributes<HTMLInputElement>>;
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
107
107
|
declare const classes: (props?: ({
|
|
108
108
|
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
|
|
109
109
|
rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
110
|
-
} &
|
|
110
|
+
} & class_variance_authority_types2.ClassProp) | undefined) => string;
|
|
111
111
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
112
112
|
width?: string | number;
|
|
113
113
|
height?: string | number;
|
|
@@ -121,7 +121,7 @@ declare function Skeleton({
|
|
|
121
121
|
height,
|
|
122
122
|
className,
|
|
123
123
|
...props
|
|
124
|
-
}: SkeletonProps):
|
|
124
|
+
}: SkeletonProps): react_jsx_runtime12.JSX.Element;
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/ui/stable-text/stable-text.d.ts
|
|
127
127
|
declare function StableText({
|
|
@@ -130,6 +130,6 @@ declare function StableText({
|
|
|
130
130
|
...props
|
|
131
131
|
}: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
132
132
|
children: string | number;
|
|
133
|
-
}):
|
|
133
|
+
}): react_jsx_runtime12.JSX.Element;
|
|
134
134
|
//#endregion
|
|
135
135
|
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalEitherWrapper, type ConditionalEitherWrapperProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
|
package/dist/ui/sheet/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../hooks
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../hooks-CUj2xuzU.cjs`);require(`../../providers-CkXkdYcB.cjs`),require(`../../use-subset-image-DC86cg6O.cjs`);let n=require(`clsx`);n=e.t(n);let r=require(`react`);r=e.t(r);let i=require(`react/jsx-runtime`),a=require(`class-variance-authority`);const o=(0,a.cva)((0,n.default)(`komc:absolute komc:bg-white komc:flex komc:flex-col komc:shadow-2xl`,`komc:transition-transform komc:duration-300 komc:ease-in-out`),{variants:{direction:{top:`komc:top-0 komc:left-0 komc:right-0 komc:-translate-y-full komc:data-[state=open]:translate-y-0`,bottom:`komc:bottom-0 komc:left-0 komc:right-0 komc:translate-y-full komc:data-[state=open]:translate-y-0`,left:`komc:top-0 komc:bottom-0 komc:left-0 komc:-translate-x-full komc:data-[state=open]:translate-x-0`,right:`komc:top-0 komc:bottom-0 komc:right-0 komc:translate-x-full komc:data-[state=open]:translate-x-0`}}}),s=(0,a.cva)(``,{variants:{size:{full:``,half:``,auto:``},direction:{top:``,bottom:``,left:``,right:``}},compoundVariants:[{size:`full`,direction:`top`,className:`komc:h-full`},{size:`full`,direction:`bottom`,className:`komc:h-full`},{size:`full`,direction:`left`,className:`komc:w-full`},{size:`full`,direction:`right`,className:`komc:w-full`},{size:`half`,direction:`top`,className:`komc:h-[50dvh]`},{size:`half`,direction:`bottom`,className:`komc:h-[50dvh]`},{size:`half`,direction:`left`,className:`komc:w-[50dvw]`},{size:`half`,direction:`right`,className:`komc:w-[50dvw]`},{size:`auto`,direction:`top`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`bottom`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`left`,className:`komc:w-auto komc:max-w-[90dvw]`},{size:`auto`,direction:`right`,className:`komc:w-auto komc:max-w-[90dvw]`}]});function c({isOpen:e,onClose:a,direction:c=`bottom`,size:l=`full`,children:u,className:d,closeOnBackdropClick:f=!0,zIndex:p=1001}){let m=t.o(e,300),[h,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(e&&m){let e=setTimeout(()=>g(!0),10);return()=>clearTimeout(e)}else e||g(!1)},[e,m]);let _=(0,r.useCallback)(e=>{e.key===`Escape`&&a()},[a]),v=(0,r.useCallback)(()=>{f&&a()},[f,a]);return(0,r.useEffect)(()=>(e?(document.addEventListener(`keydown`,_),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,_),document.body.style.overflow=`unset`}),[e,_]),m?(0,i.jsxs)(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:p},children:[(0,i.jsx)(`button`,{type:`button`,"data-state":h?`open`:`closed`,className:(0,n.default)(`komc:absolute komc:inset-0 komc:w-full komc:h-full komc:bg-black/40 komc:cursor-default`,`komc:transition-opacity komc:duration-300 komc:ease-in-out`,`komc:opacity-0 komc:data-[state=open]:opacity-100`),onClick:v,"aria-label":`close sheet`}),(0,i.jsx)(`div`,{"data-state":h?`open`:`closed`,className:(0,n.default)(o({direction:c,className:d}),s({direction:c,size:l})),role:`dialog`,"aria-modal":`true`,children:u})]}):null}exports.Sheet=c;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/ui/sheet/sheet.d.ts
|
|
5
5
|
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -23,6 +23,6 @@ declare function Sheet({
|
|
|
23
23
|
className,
|
|
24
24
|
closeOnBackdropClick,
|
|
25
25
|
zIndex
|
|
26
|
-
}: SheetProps):
|
|
26
|
+
}: SheetProps): react_jsx_runtime8.JSX.Element | null;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { Sheet, type SheetProps };
|
package/dist/ui/sheet/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"../../src-CukOR3K2.mjs";import"../../file-DShNxIW4.mjs";import{o as e}from"../../hooks-
|
|
1
|
+
"use client";import"../../src-CukOR3K2.mjs";import"../../file-DShNxIW4.mjs";import{o as e}from"../../hooks-gbU5dqVF.mjs";import"../../providers-zftmvT1z.mjs";import"../../use-subset-image-D8ssrZhj.mjs";import t from"clsx";import n,{useCallback as r,useEffect as i,useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{cva as c}from"class-variance-authority";const l=c(t(`komc:absolute komc:bg-white komc:flex komc:flex-col komc:shadow-2xl`,`komc:transition-transform komc:duration-300 komc:ease-in-out`),{variants:{direction:{top:`komc:top-0 komc:left-0 komc:right-0 komc:-translate-y-full komc:data-[state=open]:translate-y-0`,bottom:`komc:bottom-0 komc:left-0 komc:right-0 komc:translate-y-full komc:data-[state=open]:translate-y-0`,left:`komc:top-0 komc:bottom-0 komc:left-0 komc:-translate-x-full komc:data-[state=open]:translate-x-0`,right:`komc:top-0 komc:bottom-0 komc:right-0 komc:translate-x-full komc:data-[state=open]:translate-x-0`}}}),u=c(``,{variants:{size:{full:``,half:``,auto:``},direction:{top:``,bottom:``,left:``,right:``}},compoundVariants:[{size:`full`,direction:`top`,className:`komc:h-full`},{size:`full`,direction:`bottom`,className:`komc:h-full`},{size:`full`,direction:`left`,className:`komc:w-full`},{size:`full`,direction:`right`,className:`komc:w-full`},{size:`half`,direction:`top`,className:`komc:h-[50dvh]`},{size:`half`,direction:`bottom`,className:`komc:h-[50dvh]`},{size:`half`,direction:`left`,className:`komc:w-[50dvw]`},{size:`half`,direction:`right`,className:`komc:w-[50dvw]`},{size:`auto`,direction:`top`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`bottom`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`left`,className:`komc:w-auto komc:max-w-[90dvw]`},{size:`auto`,direction:`right`,className:`komc:w-auto komc:max-w-[90dvw]`}]});function d({isOpen:n,onClose:c,direction:d=`bottom`,size:f=`full`,children:p,className:m,closeOnBackdropClick:h=!0,zIndex:g=1001}){let _=e(n,300),[v,y]=a(!1);i(()=>{if(n&&_){let e=setTimeout(()=>y(!0),10);return()=>clearTimeout(e)}else n||y(!1)},[n,_]);let b=r(e=>{e.key===`Escape`&&c()},[c]),x=r(()=>{h&&c()},[h,c]);return i(()=>(n?(document.addEventListener(`keydown`,b),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,b),document.body.style.overflow=`unset`}),[n,b]),_?s(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:g},children:[o(`button`,{type:`button`,"data-state":v?`open`:`closed`,className:t(`komc:absolute komc:inset-0 komc:w-full komc:h-full komc:bg-black/40 komc:cursor-default`,`komc:transition-opacity komc:duration-300 komc:ease-in-out`,`komc:opacity-0 komc:data-[state=open]:opacity-100`),onClick:x,"aria-label":`close sheet`}),o(`div`,{"data-state":v?`open`:`closed`,className:t(l({direction:d,className:m}),u({direction:d,size:f})),role:`dialog`,"aria-modal":`true`,children:p})]}):null}export{d as Sheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`);const t=require(`../../common-Bn0Ko6B7.cjs`);require(`../../file-5mweNdAM.cjs`);const n=require(`../../hooks
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`);const t=require(`../../common-Bn0Ko6B7.cjs`);require(`../../file-5mweNdAM.cjs`);const n=require(`../../hooks-CUj2xuzU.cjs`);require(`../../providers-CkXkdYcB.cjs`),require(`../../use-subset-image-DC86cg6O.cjs`);let r=require(`clsx`);r=e.t(r);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`class-variance-authority`),s=require(`react-dom`);function c({children:e,setOpen:t}){return(0,a.jsx)(`div`,{"data-komc":!0,className:(0,r.default)(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const l=(0,o.cva)(t.n(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}}),u=(0,i.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},o)=>(0,a.jsx)(`div`,{ref:o,"data-komc":!0,role:`tooltip`,className:l({portal:e,placement:r,className:n}),...i,children:t}));var d=u;const f=(0,o.cva)(t.n(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.n(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.n(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":t.n(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.n(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.n(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.n(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}}),p=({placement:e,className:t,offset:n,...r})=>{let o=(0,i.useMemo)(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return(0,a.jsx)(`div`,{className:f({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${o}`},...r})};var m=p;const h=24,g=2,_=180,v=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function y({placement:e,className:t,content:n,open:o,hiddenRef:c,containerRef:l}){let[u,f]=(0,i.useState)(!1),[p,h]=(0,i.useState)(e),[g,_]=(0,i.useState)({top:0,left:0}),[y,b]=(0,i.useState)({x:0,y:0});(0,i.useEffect)(()=>{f(!0)},[]);let x=(0,i.useCallback)(()=>{let t=l.current,n=c.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),s=r.top,u=window.innerHeight-r.bottom;o===`bottom`&&u<i.height&&s>=i.height?a=v(a,`top`):o===`top`&&s<i.height&&u>=i.height&&(a=v(a,`bottom`)),h(a);let[d,f]=a.split(`-`),p=r.top,m=r.left+r.width/2-i.width/2;switch(d){case`top`:p-=i.height;break;case`bottom`:p+=r.height;break}switch(f){case`start`:m+=i.width/2-24;break;case`end`:m-=i.width/2-24;break}let g=m,y=window.innerWidth;g+i.width>y-4&&(g=y-i.width-4),g<4&&(g=4),_({top:p,left:g}),b({x:m-g,y:0})},[e,l,c]);return(0,i.useEffect)(()=>{if(!u||!o)return;console.log(`updateLayout`);let e=!1,t=0,n=0,r=!1;x();let i=()=>{r||=(t=requestAnimationFrame(()=>{e||x(),r=!1}),!0)};window.addEventListener(`scroll`,i,{passive:!0}),window.addEventListener(`resize`,i);let a=0,s=0,c=``,d=()=>{if(e||a>=180)return;let t=l.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===c?s+=1:(s=0,c=n,x())}s<2&&(a+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i)}},[u,o,x,l]),u?(0,s.createPortal)((0,a.jsxs)(d,{portal:!0,"data-komc":!0,placement:p,className:(0,r.default)(t,o?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[(0,a.jsx)(`span`,{children:n}),(0,a.jsx)(m,{placement:p,offset:y})]}),document.body):null}const b=(0,i.forwardRef)(({children:e,content:t,defaultOpen:o=!1,className:s,placement:l=`top`})=>{let[u,f]=(0,i.useState)(o),p=(0,i.useRef)(null),m=(0,i.useRef)(null);return n.i({ref:p,setOpen:f}),(0,a.jsxs)(`div`,{ref:p,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,a.jsx)(c,{setOpen:f,children:e}),(0,a.jsx)(y,{placement:l,className:s,open:u,content:t,hiddenRef:m,containerRef:p}),(0,a.jsx)(d,{ref:m,role:`presentation`,"aria-hidden":`true`,placement:l,className:(0,r.default)(`komc:opacity-0 komc:invisible`,s),children:(0,a.jsx)(`span`,{children:t})})]})});var x=b;exports.Tooltip=x;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react0 from "react";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ui/tooltip/tooltip-container.d.ts
|
|
@@ -11,6 +11,6 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
11
11
|
placement?: TooltipPlacement;
|
|
12
12
|
defaultOpen?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const TooltipContainer:
|
|
14
|
+
declare const TooltipContainer: react0.ForwardRefExoticComponent<TooltipContainerProps & react0.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"../../src-CukOR3K2.mjs";import{n as e}from"../../common-Df03Ovdm.mjs";import"../../file-DShNxIW4.mjs";import{i as t}from"../../hooks-
|
|
1
|
+
"use client";import"../../src-CukOR3K2.mjs";import{n as e}from"../../common-Df03Ovdm.mjs";import"../../file-DShNxIW4.mjs";import{i as t}from"../../hooks-gbU5dqVF.mjs";import"../../providers-zftmvT1z.mjs";import"../../use-subset-image-D8ssrZhj.mjs";import n from"clsx";import{forwardRef as r,useCallback as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{cva as d}from"class-variance-authority";import{createPortal as f}from"react-dom";function p({children:e,setOpen:t}){return l(`div`,{"data-komc":!0,className:n(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const m=d(e(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var h=r(({portal:e,children:t,className:n,placement:r,...i},a)=>l(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:m({portal:e,placement:r,className:n}),...i,children:t}));const g=d(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var _=({placement:e,className:t,offset:n,...r})=>{let i=o(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return l(`div`,{className:g({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${i}`},...r})};const v=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function y({placement:e,className:t,content:r,open:o,hiddenRef:s,containerRef:d}){let[p,m]=c(!1),[g,y]=c(e),[b,x]=c({top:0,left:0}),[S,C]=c({x:0,y:0});a(()=>{m(!0)},[]);let w=i(()=>{let t=d.current,n=s.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),c=r.top,l=window.innerHeight-r.bottom;o===`bottom`&&l<i.height&&c>=i.height?a=v(a,`top`):o===`top`&&c<i.height&&l>=i.height&&(a=v(a,`bottom`)),y(a);let[u,f]=a.split(`-`),p=r.top,m=r.left+r.width/2-i.width/2;switch(u){case`top`:p-=i.height;break;case`bottom`:p+=r.height;break}switch(f){case`start`:m+=i.width/2-24;break;case`end`:m-=i.width/2-24;break}let h=m,g=window.innerWidth;h+i.width>g-4&&(h=g-i.width-4),h<4&&(h=4),x({top:p,left:h}),C({x:m-h,y:0})},[e,d,s]);return a(()=>{if(!p||!o)return;console.log(`updateLayout`);let e=!1,t=0,n=0,r=!1;w();let i=()=>{r||=(t=requestAnimationFrame(()=>{e||w(),r=!1}),!0)};window.addEventListener(`scroll`,i,{passive:!0}),window.addEventListener(`resize`,i);let a=0,s=0,c=``,l=()=>{if(e||a>=180)return;let t=d.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===c?s+=1:(s=0,c=n,w())}s<2&&(a+=1,n=requestAnimationFrame(l))};return n=requestAnimationFrame(l),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i)}},[p,o,w,d]),p?f(u(h,{portal:!0,"data-komc":!0,placement:g,className:n(t,o?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[l(`span`,{children:r}),l(_,{placement:g,offset:S})]}),document.body):null}var b=r(({children:e,content:r,defaultOpen:i=!1,className:a,placement:o=`top`})=>{let[d,f]=c(i),m=s(null),g=s(null);return t({ref:m,setOpen:f}),u(`div`,{ref:m,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[l(p,{setOpen:f,children:e}),l(y,{placement:o,className:a,open:d,content:r,hiddenRef:g,containerRef:m}),l(h,{ref:g,role:`presentation`,"aria-hidden":`true`,placement:o,className:n(`komc:opacity-0 komc:invisible`,a),children:l(`span`,{children:r})})]})});export{b as Tooltip};
|
package/dist/util/common.d.cts
CHANGED
|
@@ -31,7 +31,7 @@ declare const getI18nValue: <T extends {
|
|
|
31
31
|
}>(locale?: string, values?: T[], key?: keyof T) => string;
|
|
32
32
|
declare const comparePriorityAsc: <T extends {
|
|
33
33
|
priority: number;
|
|
34
|
-
}>(a: T, b: T) =>
|
|
34
|
+
}>(a: T, b: T) => 0 | 1 | -1;
|
|
35
35
|
declare const parseQuery: <T, F = T>(q: string | string[] | undefined | null, conv: (v: string) => T, fallback: F) => T | F;
|
|
36
36
|
declare const withoutProperty: <T, K extends keyof T>(obj: T, property: K) => Omit<T, K>;
|
|
37
37
|
declare const withoutProperties: <T extends Record<string, unknown>>(obj: T, properties: Array<keyof T>) => T;
|
package/dist/util/common.d.mts
CHANGED
|
@@ -31,7 +31,7 @@ declare const getI18nValue: <T extends {
|
|
|
31
31
|
}>(locale?: string, values?: T[], key?: keyof T) => string;
|
|
32
32
|
declare const comparePriorityAsc: <T extends {
|
|
33
33
|
priority: number;
|
|
34
|
-
}>(a: T, b: T) =>
|
|
34
|
+
}>(a: T, b: T) => 0 | 1 | -1;
|
|
35
35
|
declare const parseQuery: <T, F = T>(q: string | string[] | undefined | null, conv: (v: string) => T, fallback: F) => T | F;
|
|
36
36
|
declare const withoutProperty: <T, K extends keyof T>(obj: T, property: K) => Omit<T, K>;
|
|
37
37
|
declare const withoutProperties: <T extends Record<string, unknown>>(obj: T, properties: Array<keyof T>) => T;
|
package/package.json
CHANGED
package/dist/hooks--O5RcEJq.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`lodash-es`),n=require(`react`);function r(e,t){let[r,i]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let n;return e&&!r?i(!0):!e&&r&&(n=setTimeout(()=>i(!1),t)),()=>clearTimeout(n)},[e,t,r]),r}function i(e=1){let t=(0,n.useRef)(null),[r,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)(0),[s,c]=(0,n.useState)(0),l=(0,n.useRef)(!1);return{ref:t,onMouseDown:e=>{t.current&&(i(!0),l.current=!1,o(e.pageX-t.current.offsetLeft),c(t.current.scrollLeft))},onMouseLeave:()=>i(!1),onMouseUp:()=>i(!1),onMouseMove:n=>{if(!r||!t.current)return;n.preventDefault();let i=(n.pageX-t.current.offsetLeft-a)*e;Math.abs(i)>10&&(l.current=!0),t.current.scrollLeft=s-i},onClickCapture:e=>{l.current&&(e.stopPropagation(),e.preventDefault())}}}function a({ref:e,setOpen:t}){let r=(0,n.useCallback)(n=>{e.current?.contains(n.target)||t(!1)},[e,t]);(0,n.useEffect)(()=>(document.addEventListener(`mousedown`,r),document.addEventListener(`touchstart`,r),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`touchstart`,r)}),[r])}const o=[`mouse`,`touch`];function s({open:e,type:t=o}){let r=(0,n.useCallback)(e=>{e.preventDefault()},[]),i=(0,n.useCallback)(e=>{e.preventDefault()},[]);(0,n.useEffect)(()=>{let n=e&&t.includes(`mouse`),a=e&&t.includes(`touch`);return n?(document.body.classList.add(`overflow-hidden`),document.addEventListener(`wheel`,i,{passive:!1})):(document.body.classList.remove(`overflow-hidden`),document.removeEventListener(`wheel`,i)),a?document.addEventListener(`touchmove`,r,{passive:!1}):document.removeEventListener(`touchmove`,r),()=>{document.body.classList.remove(`overflow-hidden`),document.removeEventListener(`touchmove`,r),document.removeEventListener(`wheel`,i)}},[e,t,r,i])}function c({enabled:e=!0,behavior:t=`smooth`}={}){let[r,i]=(0,n.useState)(!1),a=(0,n.useRef)(null),o=(0,n.useCallback)(()=>{window.scrollTo({top:0,behavior:t})},[t]);return(0,n.useEffect)(()=>{let t=a.current;if(!t||!e){i(!1);return}let n=new IntersectionObserver(e=>{let t=e[0];t&&i(!t.isIntersecting)},{root:null,rootMargin:`0px`,threshold:0});return n.observe(t),()=>n.disconnect()},[e]),{isVisible:r,handleScrolToTop:o,ref:a}}function l(e=1280){let[r,i]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let e=(0,t.throttle)(()=>{let e=window.innerWidth;i(e)},200);return window.addEventListener(`resize`,e),e(),()=>window.removeEventListener(`resize`,e)},[]),{windowSize:r}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
package/dist/hooks-C9rXWkfW.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{throttle as e}from"lodash-es";import{useCallback as t,useEffect as n,useRef as r,useState as i}from"react";function a(e,t){let[r,a]=i(!1);return n(()=>{let n;return e&&!r?a(!0):!e&&r&&(n=setTimeout(()=>a(!1),t)),()=>clearTimeout(n)},[e,t,r]),r}function o(e=1){let t=r(null),[n,a]=i(!1),[o,s]=i(0),[c,l]=i(0),u=r(!1);return{ref:t,onMouseDown:e=>{t.current&&(a(!0),u.current=!1,s(e.pageX-t.current.offsetLeft),l(t.current.scrollLeft))},onMouseLeave:()=>a(!1),onMouseUp:()=>a(!1),onMouseMove:r=>{if(!n||!t.current)return;r.preventDefault();let i=(r.pageX-t.current.offsetLeft-o)*e;Math.abs(i)>10&&(u.current=!0),t.current.scrollLeft=c-i},onClickCapture:e=>{u.current&&(e.stopPropagation(),e.preventDefault())}}}function s({ref:e,setOpen:r}){let i=t(t=>{e.current?.contains(t.target)||r(!1)},[e,r]);n(()=>(document.addEventListener(`mousedown`,i),document.addEventListener(`touchstart`,i),()=>{document.removeEventListener(`mousedown`,i),document.removeEventListener(`touchstart`,i)}),[i])}const c=[`mouse`,`touch`];function l({open:e,type:r=c}){let i=t(e=>{e.preventDefault()},[]),a=t(e=>{e.preventDefault()},[]);n(()=>{let t=e&&r.includes(`mouse`),n=e&&r.includes(`touch`);return t?(document.body.classList.add(`overflow-hidden`),document.addEventListener(`wheel`,a,{passive:!1})):(document.body.classList.remove(`overflow-hidden`),document.removeEventListener(`wheel`,a)),n?document.addEventListener(`touchmove`,i,{passive:!1}):document.removeEventListener(`touchmove`,i),()=>{document.body.classList.remove(`overflow-hidden`),document.removeEventListener(`touchmove`,i),document.removeEventListener(`wheel`,a)}},[e,r,i,a])}function u({enabled:e=!0,behavior:a=`smooth`}={}){let[o,s]=i(!1),c=r(null),l=t(()=>{window.scrollTo({top:0,behavior:a})},[a]);return n(()=>{let t=c.current;if(!t||!e){s(!1);return}let n=new IntersectionObserver(e=>{let t=e[0];t&&s(!t.isIntersecting)},{root:null,rootMargin:`0px`,threshold:0});return n.observe(t),()=>n.disconnect()},[e]),{isVisible:o,handleScrolToTop:l,ref:c}}function d(t=1280){let[r,a]=i(t);return n(()=>{let t=e(()=>{let e=window.innerWidth;a(e)},200);return window.addEventListener(`resize`,t),t(),()=>window.removeEventListener(`resize`,t)},[]),{windowSize:r}}export{o as a,s as i,u as n,a as o,l as r,d as t};
|