@machinerd/js-module 0.8.0 → 0.9.0
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/README.md +6 -0
- package/dist/api-client-C0sbSOQf.mjs +1 -0
- package/dist/api-client-C3o2pO0q.cjs +1 -0
- package/dist/button-CQZuaIU7.mjs +1 -0
- package/dist/button-ChX3XGbR.cjs +1 -0
- package/dist/button-DHvx-GAg.d.cts +50 -0
- package/dist/button-DRIyBtEB.d.mts +50 -0
- package/dist/common-B8HXyhZa.cjs +1 -0
- package/dist/common-CWHkXe0F.mjs +1 -0
- package/dist/{common-Bn0Ko6B7.cjs → common-D4sUwkFd.cjs} +1 -1
- package/dist/{common-Df03Ovdm.mjs → common-ZUMpASnc.mjs} +1 -1
- package/dist/editor/index.cjs +1 -0
- package/dist/editor/index.d.cts +80 -0
- package/dist/editor/index.d.mts +80 -0
- package/dist/editor/index.mjs +1 -0
- package/dist/format-1_RTNUQv.mjs +1 -0
- package/dist/format-DEuImTYJ.cjs +1 -0
- package/dist/hooks/common/index.cjs +1 -0
- package/dist/hooks/common/index.d.cts +72 -0
- package/dist/hooks/common/index.d.mts +72 -0
- package/dist/hooks/common/index.mjs +1 -0
- package/dist/hooks/use-snackbar.cjs +1 -0
- package/dist/hooks/use-snackbar.d.cts +10 -0
- package/dist/hooks/use-snackbar.d.mts +10 -0
- package/dist/hooks/use-snackbar.mjs +1 -0
- package/dist/{index-B3fFA21M.d.mts → index-B1YNV_Vm.d.cts} +4 -0
- package/dist/{index-CeiAF-WU.d.cts → index-C8chDULk.d.mts} +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/providers/api-client/index.cjs +1 -0
- package/dist/providers/{index.d.cts → api-client/index.d.cts} +3 -3
- package/dist/providers/{index.d.mts → api-client/index.d.mts} +3 -3
- package/dist/providers/api-client/index.mjs +1 -0
- package/dist/providers/noti-stack/index.cjs +1 -0
- package/dist/providers/noti-stack/index.d.cts +11 -0
- package/dist/providers/noti-stack/index.d.mts +11 -0
- package/dist/providers/noti-stack/index.mjs +1 -0
- package/dist/{skeleton-DtV9S1QK.cjs → skeleton-B5ZccRFX.cjs} +1 -1
- package/dist/{skeleton-B6_oBhkl.mjs → skeleton-Y22bmaaB.mjs} +1 -1
- package/dist/src-6KfzqI9Z.cjs +1 -0
- package/dist/src-CIMlbgv1.mjs +1 -0
- package/dist/styles/editor.css +255 -0
- package/dist/styles/index.css +371 -0
- package/dist/ui/carousel/index.cjs +1 -1
- package/dist/ui/carousel/index.d.cts +9 -9
- package/dist/ui/carousel/index.d.mts +9 -9
- package/dist/ui/carousel/index.mjs +1 -1
- package/dist/ui/dialog/index.cjs +1 -1
- package/dist/ui/dialog/index.d.cts +1 -1
- package/dist/ui/dialog/index.d.mts +2 -2
- package/dist/ui/dialog/index.mjs +1 -1
- package/dist/ui/dnd/index.cjs +1 -0
- package/dist/ui/dnd/index.d.cts +17 -0
- package/dist/ui/dnd/index.d.mts +17 -0
- package/dist/ui/dnd/index.mjs +1 -0
- package/dist/ui/dropdown/index.cjs +1 -0
- package/dist/ui/dropdown/index.d.cts +72 -0
- package/dist/ui/dropdown/index.d.mts +72 -0
- package/dist/ui/dropdown/index.mjs +1 -0
- package/dist/ui/image/index.cjs +1 -1
- package/dist/ui/image/index.d.cts +8 -8
- package/dist/ui/image/index.d.mts +8 -8
- package/dist/ui/image/index.mjs +1 -1
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +12 -55
- package/dist/ui/index.d.mts +12 -55
- package/dist/ui/index.mjs +1 -1
- package/dist/ui/motion-dialog/index.cjs +1 -0
- package/dist/ui/motion-dialog/index.d.cts +34 -0
- package/dist/ui/motion-dialog/index.d.mts +34 -0
- package/dist/ui/motion-dialog/index.mjs +1 -0
- package/dist/ui/preserve-focus-button/index.cjs +1 -0
- package/dist/ui/preserve-focus-button/index.d.cts +12 -0
- package/dist/ui/preserve-focus-button/index.d.mts +12 -0
- package/dist/ui/preserve-focus-button/index.mjs +1 -0
- package/dist/ui/sheet/index.cjs +1 -1
- package/dist/ui/sheet/index.d.mts +2 -2
- package/dist/ui/sheet/index.mjs +1 -1
- package/dist/ui/switch/index.cjs +1 -0
- package/dist/ui/switch/index.d.cts +16 -0
- package/dist/ui/switch/index.d.mts +16 -0
- package/dist/ui/switch/index.mjs +1 -0
- 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/ui-Bs9PP9eC.cjs +1 -0
- package/dist/ui-D2DoC_0E.mjs +1 -0
- package/dist/use-dialog-stack-Crj8YWJl.mjs +1 -0
- package/dist/use-dialog-stack-YiLs-sNf.cjs +1 -0
- package/dist/use-drag-resize-BdeLdulk.mjs +1 -0
- package/dist/use-drag-resize-DEgcua2U.d.cts +48 -0
- package/dist/use-drag-resize-DRHPv5RK.d.mts +48 -0
- package/dist/use-drag-resize-DeDqPC4h.cjs +1 -0
- package/dist/use-subset-image-Df2fCrtH.mjs +1 -0
- package/dist/use-subset-image-Dygkyw-W.d.mts +601 -0
- package/dist/use-subset-image-bDB5TSd4.d.cts +601 -0
- package/dist/use-subset-image-o_gmC1HL.cjs +1 -0
- package/dist/util/common.cjs +1 -1
- package/dist/util/common.d.cts +9 -2
- package/dist/util/common.d.mts +9 -2
- package/dist/util/common.mjs +1 -1
- package/dist/util/editor.cjs +1 -0
- package/dist/util/editor.d.cts +21 -0
- package/dist/util/editor.d.mts +21 -0
- package/dist/util/editor.mjs +1 -0
- package/dist/util/fetcher.cjs +1 -0
- package/dist/util/fetcher.d.cts +15 -0
- package/dist/util/fetcher.d.mts +15 -0
- package/dist/util/fetcher.mjs +1 -0
- package/dist/util/file.mjs +1 -1
- package/dist/util/format.cjs +1 -1
- package/dist/util/format.d.cts +29 -1
- package/dist/util/format.d.mts +29 -1
- package/dist/util/format.mjs +1 -1
- package/package.json +104 -33
- package/dist/hooks/index.cjs +0 -1
- package/dist/hooks/index.d.cts +0 -2
- package/dist/hooks/index.d.mts +0 -2
- package/dist/hooks/index.mjs +0 -1
- package/dist/hooks--O5RcEJq.cjs +0 -1
- package/dist/hooks-C9rXWkfW.mjs +0 -1
- package/dist/index-B11XDBo5.d.cts +0 -655
- package/dist/index-dbBlRf5k.d.mts +0 -655
- package/dist/providers/index.cjs +0 -1
- package/dist/providers/index.mjs +0 -1
- package/dist/providers-CkXkdYcB.cjs +0 -1
- package/dist/providers-zftmvT1z.mjs +0 -1
- package/dist/src-CjpmdVyv.cjs +0 -1
- package/dist/src-CukOR3K2.mjs +0 -1
- package/dist/use-subset-image-D8ssrZhj.mjs +0 -1
- package/dist/use-subset-image-DC86cg6O.cjs +0 -1
- /package/dist/{file-DShNxIW4.mjs → file-B-UJkabO.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ComponentProps } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime5 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_runtime5.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_runtime5.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_runtime5.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_runtime5.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_runtime5.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_runtime5.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_runtime5.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_runtime5.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_runtime10 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_runtime10.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_runtime10.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_runtime10.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_runtime10.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_runtime10.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_runtime10.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_runtime10.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_runtime10.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 +1 @@
|
|
|
1
|
-
"use client";import{n as e}from"../../common-
|
|
1
|
+
"use client";import{n as e}from"../../common-ZUMpASnc.mjs";import t,{useCallback as n,useEffect as r,useState as i}from"react";import{Fragment as a,jsx as o}from"react/jsx-runtime";import s from"clsx";import c from"embla-carousel-react";const l=t.createContext(null);function u(){let e=t.useContext(l);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function d({orientation:t=`horizontal`,options:a,setApi:s,plugins:u,className:d,children:f,...p}){let[m,h]=c({...a,axis:t===`horizontal`?`x`:`y`},u),[g,_]=i(!1),[v,y]=i(!1),[b,x]=i(0),[S,C]=i(0),w=n(e=>{e&&(_(e.canScrollPrev()),y(e.canScrollNext()),C(e.selectedScrollSnap()))},[]),T=n(()=>{h?.scrollPrev()},[h]),E=n(()=>{h?.scrollNext()},[h]),D=n(e=>{h?.scrollTo(e)},[h]),O=n(()=>{x(h?.scrollSnapList().length||0)},[h]),k=n(e=>{t===`horizontal`?e.key===`ArrowLeft`?(e.preventDefault(),T()):e.key===`ArrowRight`&&(e.preventDefault(),E()):e.key===`ArrowUp`?(e.preventDefault(),T()):e.key===`ArrowDown`&&(e.preventDefault(),E())},[T,E,t]);return r(()=>{!h||!s||s(h)},[h,s]),r(()=>{if(h)return w(h),O(),h.on(`reInit`,O),h.on(`reInit`,w),h.on(`select`,w),()=>{h?.off(`select`,w)}},[h,O,w]),o(l.Provider,{value:{carouselRef:m,api:h,options:a,orientation:t||(a?.axis===`y`?`vertical`:`horizontal`),scrollPrev:T,scrollNext:E,canScrollPrev:g,canScrollNext:v,scrollTo:D,dots:b,selectedScrollSnap:S},children:o(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:k,className:e(`komc:relative`,d),...p,children:f})})}function f({children:t,className:n,...r}){let{carouselRef:i}=u();return o(`div`,{ref:i,"data-komc":!0,className:e(`komc:h-full komc:overflow-hidden`,n),...r,children:t})}function p({className:t,...n}){let{orientation:r}=u();return o(`div`,{"data-komc":!0,className:e(`komc:flex komc:h-full`,r===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,t),...n})}function m({className:t,...n}){let{orientation:r}=u();return o(`div`,{"data-komc":!0,className:e(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,t),...n})}function h({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=u();return o(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:s(`komc:w-full`,t),onClick:r,...n,children:e})}function g({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=u();return o(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:s(`komc:w-full`,t),onClick:r,...n,children:e})}function _({children:e,...t}){let{dots:n,selectedScrollSnap:r,scrollTo:i}=u();return o(a,{children:Array.from({length:n}).map((n,a)=>o(`button`,{type:`button`,"data-komc":!0,"data-selected":r===a,"aria-label":`go to slide ${a+1}`,onClick:()=>i(a),...t,children:e?.(a)},a))})}function v({index:e,children:t,...n}){let{selectedScrollSnap:r,scrollTo:i}=u();return o(`button`,{type:`button`,"data-komc":!0,"data-selected":r===e,"aria-label":`go to slide ${e+1}`,onClick:()=>i(e),...n,children:t})}export{d as Carousel,v as CarouselDot,_ as CarouselDots,m as CarouselItem,g as CarouselNext,h as CarouselPrevious,f as CarouselViewport,p as CarouselWrapper,u as useCarousel};
|
package/dist/ui/dialog/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-6KfzqI9Z.cjs`),require(`../../file-5mweNdAM.cjs`),require(`../../use-drag-resize-DeDqPC4h.cjs`);const t=require(`../../common-B8HXyhZa.cjs`),n=require(`../../use-dialog-stack-YiLs-sNf.cjs`);require(`../../api-client-C3o2pO0q.cjs`),require(`../../use-subset-image-o_gmC1HL.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`class-variance-authority`);const o=(0,a.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 s({closeOnBackdropClick:e=!0,isOpen:a,zIndex:s=1e4,padding:c,maxWidth:l,className:u,onClose:d,children:f,...p}){let m=t.l(a,300),[h,g]=(0,r.useState)(!1);n.t(a,d),(0,r.useEffect)(()=>{if(a&&m){let e=setTimeout(()=>g(!0),10);return()=>clearTimeout(e)}else a||g(!1)},[a,m]);let _=(0,r.useCallback)(()=>{e&&d()},[e,d]);return m?(0,i.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:s},children:(0,i.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,i.jsx)(`button`,{type:`button`,"data-state":h?`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,i.jsx)(`div`,{"data-state":h?`open`:`closed`,className:`${o({padding:c,maxWidth:l,className:u})} 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`,...p,children:f})]})}):null}exports.Dialog=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
2
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/ui/dialog/dialog.d.ts
|
|
7
7
|
declare const classes: (props?: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
5
|
|
|
@@ -25,6 +25,6 @@ declare function Dialog({
|
|
|
25
25
|
onClose,
|
|
26
26
|
children,
|
|
27
27
|
...rest
|
|
28
|
-
}: DialogProps):
|
|
28
|
+
}: DialogProps): react_jsx_runtime8.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-
|
|
1
|
+
"use client";import"../../src-CIMlbgv1.mjs";import"../../file-B-UJkabO.mjs";import"../../use-drag-resize-BdeLdulk.mjs";import{l as e}from"../../common-CWHkXe0F.mjs";import{t}from"../../use-dialog-stack-Crj8YWJl.mjs";import"../../api-client-C0sbSOQf.mjs";import"../../use-subset-image-Df2fCrtH.mjs";import{useCallback as n,useEffect as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";const c=s(`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 l({closeOnBackdropClick:s=!0,isOpen:l,zIndex:u=1e4,padding:d,maxWidth:f,className:p,onClose:m,children:h,...g}){let _=e(l,300),[v,y]=i(!1);t(l,m),r(()=>{if(l&&_){let e=setTimeout(()=>y(!0),10);return()=>clearTimeout(e)}else l||y(!1)},[l,_]);let b=n(()=>{s&&m()},[s,m]);return _?a(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden`,style:{zIndex:u},children:o(`div`,{className:`komc:relative komc:flex komc:min-h-0 komc:flex-1 komc:w-full komc:items-center komc:justify-center`,children:[a(`button`,{type:`button`,"data-state":v?`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`}),a(`div`,{"data-state":v?`open`:`closed`,className:`${c({padding:d,maxWidth:f,className:p})} 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`,...g,children:h})]})}):null}export{l as Dialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);let t=require(`react/jsx-runtime`),n=require(`@dnd-kit/sortable`),r=require(`@dnd-kit/utilities`);function i({id:e,render:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=(0,n.useSortable)({id:e});return(0,t.jsx)(`div`,{ref:s,"data-komc":!0,style:{width:`100%`,zIndex:u?`100`:`auto`,opacity:u?.7:1,transform:r.CSS.Translate.toString(c),transition:l},children:i(a,o)})}exports.DndItem=i;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
3
|
+
import { DraggableAttributes } from "@dnd-kit/core";
|
|
4
|
+
import { useSortable } from "@dnd-kit/sortable";
|
|
5
|
+
|
|
6
|
+
//#region src/ui/dnd/dnd-item.d.ts
|
|
7
|
+
type SortableListeners = ReturnType<typeof useSortable>['listeners'];
|
|
8
|
+
interface DndItemProps {
|
|
9
|
+
id: string;
|
|
10
|
+
render: (attributes: DraggableAttributes, listeners?: SortableListeners) => ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function DndItem({
|
|
13
|
+
id,
|
|
14
|
+
render
|
|
15
|
+
}: DndItemProps): react_jsx_runtime10.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DndItem };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { useSortable } from "@dnd-kit/sortable";
|
|
4
|
+
import { DraggableAttributes } from "@dnd-kit/core";
|
|
5
|
+
|
|
6
|
+
//#region src/ui/dnd/dnd-item.d.ts
|
|
7
|
+
type SortableListeners = ReturnType<typeof useSortable>['listeners'];
|
|
8
|
+
interface DndItemProps {
|
|
9
|
+
id: string;
|
|
10
|
+
render: (attributes: DraggableAttributes, listeners?: SortableListeners) => ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function DndItem({
|
|
13
|
+
id,
|
|
14
|
+
render
|
|
15
|
+
}: DndItemProps): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DndItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{useSortable as t}from"@dnd-kit/sortable";import{CSS as n}from"@dnd-kit/utilities";function r({id:r,render:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=t({id:r});return e(`div`,{ref:s,"data-komc":!0,style:{width:`100%`,zIndex:u?`100`:`auto`,opacity:u?.7:1,transform:n.Translate.toString(c),transition:l},children:i(a,o)})}export{r as DndItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../common-D4sUwkFd.cjs`),n=require(`../../use-dialog-stack-YiLs-sNf.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`@radix-ui/react-slot`),o=require(`@floating-ui/react`);const s=(0,r.createContext)(null);function c(){let e=(0,r.useContext)(s);if(!e)throw Error(`useDropdown must be used within Dropdown`);return e}function l(){return(0,r.useContext)(s)}function u({className:e,children:n,onMouseDown:r,onClick:a,...s}){let{open:l,refs:u,floatingStyles:d,getFloatingProps:f,preserveFocus:p}=c();return l?(0,i.jsx)(o.FloatingPortal,{children:(0,i.jsx)(`div`,{"data-komc":!0,...f({...s,ref:u.setFloating,style:{...d,...s.style},className:t.n(`komc:z-50 komc:mt-0.5 komc:drop-shadow-md`,e),onMouseDown:e=>{p&&e.preventDefault(),r?.(e)},onClick:e=>{e.stopPropagation(),a?.(e)}}),children:n})}):null}function d({asChild:e=!0,className:n,type:r=`button`,...o}){let{open:s,refs:l,getReferenceProps:u}=c();return(0,i.jsx)(e?a.Slot:`button`,{"data-komc":!0,"data-state":s?`open`:`closed`,type:e?void 0:r,className:t.n(!e&&`komc:inline-flex komc:items-center komc:outline-none`,n),...u({...o,ref:l.setReference})})}function f({trigger:e,reference:t,children:a,placement:c=`bottom-start`,boundary:l,offset:f=8,maxWidth:p,maxHeight:m=300,className:h,open:g,onOpenChange:_,preserveFocus:v=!1,role:y=`menu`}){let b=g!==void 0,[x,S]=(0,r.useState)(!1),C=b?g:x,w=(0,r.useCallback)(e=>{b||S(e),_?.(e)},[b,_]),T=(0,r.useCallback)(()=>w(!1),[w]);n.t(C,T,!1);let{refs:E,floatingStyles:D,context:O}=(0,o.useFloating)({open:C,onOpenChange:w,placement:c,whileElementsMounted:o.autoUpdate,middleware:(0,r.useMemo)(()=>[(0,o.offset)(f),(0,o.flip)({boundary:l??void 0,padding:8}),(0,o.shift)({boundary:l??void 0,padding:8}),(0,o.size)({boundary:l??void 0,padding:8,apply({availableHeight:e,availableWidth:t,elements:n}){let r={maxHeight:`${Math.min(e,m)}px`,overflowY:`auto`};p!=null&&(r.maxWidth=`${Math.min(t,p)}px`),Object.assign(n.floating.style,r)}})],[l,m,p,f])}),{getReferenceProps:k,getFloatingProps:A}=(0,o.useInteractions)([(0,o.useClick)(O),(0,o.useDismiss)(O,{escapeKey:!1}),(0,o.useRole)(O,{role:y})]);(0,r.useEffect)(()=>{t&&E.setPositionReference(t)},[t,E]);let j=(0,r.useMemo)(()=>({open:C,setOpen:w,close:T,refs:E,floatingStyles:D,getReferenceProps:k,getFloatingProps:A,preserveFocus:v}),[T,D,A,k,C,v,E,w]);return(0,i.jsxs)(s.Provider,{value:j,children:[e?(0,i.jsx)(d,{asChild:!0,children:e}):null,e?(0,i.jsx)(u,{className:h,children:a}):a]})}exports.Dropdown=f,exports.DropdownContent=u,exports.DropdownTrigger=d,exports.useDropdown=c,exports.useOptionalDropdown=l;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CSSProperties, ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
3
|
+
import { Placement, VirtualElement, useFloating, useInteractions } from "@floating-ui/react";
|
|
4
|
+
|
|
5
|
+
//#region src/ui/dropdown/dropdown.d.ts
|
|
6
|
+
interface DropdownProps {
|
|
7
|
+
trigger?: ReactElement;
|
|
8
|
+
reference?: VirtualElement;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
placement?: Placement;
|
|
11
|
+
boundary?: Element | null;
|
|
12
|
+
offset?: number;
|
|
13
|
+
maxWidth?: number;
|
|
14
|
+
maxHeight?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
open?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
preserveFocus?: boolean;
|
|
19
|
+
role?: 'menu' | 'listbox' | 'dialog';
|
|
20
|
+
}
|
|
21
|
+
declare function Dropdown({
|
|
22
|
+
trigger,
|
|
23
|
+
reference,
|
|
24
|
+
children,
|
|
25
|
+
placement,
|
|
26
|
+
boundary,
|
|
27
|
+
offset,
|
|
28
|
+
maxWidth,
|
|
29
|
+
maxHeight,
|
|
30
|
+
className,
|
|
31
|
+
open: controlledOpen,
|
|
32
|
+
onOpenChange,
|
|
33
|
+
preserveFocus,
|
|
34
|
+
role
|
|
35
|
+
}: DropdownProps): react_jsx_runtime17.JSX.Element;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/ui/dropdown/dropdown-trigger.d.ts
|
|
38
|
+
interface DropdownTriggerProps extends ComponentProps<'button'> {
|
|
39
|
+
asChild?: boolean;
|
|
40
|
+
}
|
|
41
|
+
declare function DropdownTrigger({
|
|
42
|
+
asChild,
|
|
43
|
+
className,
|
|
44
|
+
type,
|
|
45
|
+
...rest
|
|
46
|
+
}: DropdownTriggerProps): react_jsx_runtime17.JSX.Element;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/ui/dropdown/dropdown-content.d.ts
|
|
49
|
+
type DropdownContentProps = ComponentProps<'div'>;
|
|
50
|
+
declare function DropdownContent({
|
|
51
|
+
className,
|
|
52
|
+
children,
|
|
53
|
+
onMouseDown,
|
|
54
|
+
onClick,
|
|
55
|
+
...rest
|
|
56
|
+
}: DropdownContentProps): react_jsx_runtime17.JSX.Element | null;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/ui/dropdown/dropdown-context.d.ts
|
|
59
|
+
interface DropdownContextValue {
|
|
60
|
+
open: boolean;
|
|
61
|
+
setOpen: (open: boolean) => void;
|
|
62
|
+
close: () => void;
|
|
63
|
+
refs: ReturnType<typeof useFloating>['refs'];
|
|
64
|
+
floatingStyles: CSSProperties;
|
|
65
|
+
getReferenceProps: ReturnType<typeof useInteractions>['getReferenceProps'];
|
|
66
|
+
getFloatingProps: ReturnType<typeof useInteractions>['getFloatingProps'];
|
|
67
|
+
preserveFocus: boolean;
|
|
68
|
+
}
|
|
69
|
+
declare function useDropdown(): DropdownContextValue;
|
|
70
|
+
declare function useOptionalDropdown(): DropdownContextValue | null;
|
|
71
|
+
//#endregion
|
|
72
|
+
export { Dropdown, DropdownContent, type DropdownContentProps, type DropdownProps, DropdownTrigger, type DropdownTriggerProps, useDropdown, useOptionalDropdown };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CSSProperties, ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
|
+
import { Placement, VirtualElement, useFloating, useInteractions } from "@floating-ui/react";
|
|
4
|
+
|
|
5
|
+
//#region src/ui/dropdown/dropdown.d.ts
|
|
6
|
+
interface DropdownProps {
|
|
7
|
+
trigger?: ReactElement;
|
|
8
|
+
reference?: VirtualElement;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
placement?: Placement;
|
|
11
|
+
boundary?: Element | null;
|
|
12
|
+
offset?: number;
|
|
13
|
+
maxWidth?: number;
|
|
14
|
+
maxHeight?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
open?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
preserveFocus?: boolean;
|
|
19
|
+
role?: 'menu' | 'listbox' | 'dialog';
|
|
20
|
+
}
|
|
21
|
+
declare function Dropdown({
|
|
22
|
+
trigger,
|
|
23
|
+
reference,
|
|
24
|
+
children,
|
|
25
|
+
placement,
|
|
26
|
+
boundary,
|
|
27
|
+
offset,
|
|
28
|
+
maxWidth,
|
|
29
|
+
maxHeight,
|
|
30
|
+
className,
|
|
31
|
+
open: controlledOpen,
|
|
32
|
+
onOpenChange,
|
|
33
|
+
preserveFocus,
|
|
34
|
+
role
|
|
35
|
+
}: DropdownProps): react_jsx_runtime5.JSX.Element;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/ui/dropdown/dropdown-trigger.d.ts
|
|
38
|
+
interface DropdownTriggerProps extends ComponentProps<'button'> {
|
|
39
|
+
asChild?: boolean;
|
|
40
|
+
}
|
|
41
|
+
declare function DropdownTrigger({
|
|
42
|
+
asChild,
|
|
43
|
+
className,
|
|
44
|
+
type,
|
|
45
|
+
...rest
|
|
46
|
+
}: DropdownTriggerProps): react_jsx_runtime5.JSX.Element;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/ui/dropdown/dropdown-content.d.ts
|
|
49
|
+
type DropdownContentProps = ComponentProps<'div'>;
|
|
50
|
+
declare function DropdownContent({
|
|
51
|
+
className,
|
|
52
|
+
children,
|
|
53
|
+
onMouseDown,
|
|
54
|
+
onClick,
|
|
55
|
+
...rest
|
|
56
|
+
}: DropdownContentProps): react_jsx_runtime5.JSX.Element | null;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/ui/dropdown/dropdown-context.d.ts
|
|
59
|
+
interface DropdownContextValue {
|
|
60
|
+
open: boolean;
|
|
61
|
+
setOpen: (open: boolean) => void;
|
|
62
|
+
close: () => void;
|
|
63
|
+
refs: ReturnType<typeof useFloating>['refs'];
|
|
64
|
+
floatingStyles: CSSProperties;
|
|
65
|
+
getReferenceProps: ReturnType<typeof useInteractions>['getReferenceProps'];
|
|
66
|
+
getFloatingProps: ReturnType<typeof useInteractions>['getFloatingProps'];
|
|
67
|
+
preserveFocus: boolean;
|
|
68
|
+
}
|
|
69
|
+
declare function useDropdown(): DropdownContextValue;
|
|
70
|
+
declare function useOptionalDropdown(): DropdownContextValue | null;
|
|
71
|
+
//#endregion
|
|
72
|
+
export { Dropdown, DropdownContent, type DropdownContentProps, type DropdownProps, DropdownTrigger, type DropdownTriggerProps, useDropdown, useOptionalDropdown };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{n as e}from"../../common-ZUMpASnc.mjs";import{t}from"../../use-dialog-stack-Crj8YWJl.mjs";import{createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{Slot as u}from"@radix-ui/react-slot";import{FloatingPortal as d,autoUpdate as f,flip as p,offset as m,shift as h,size as g,useClick as _,useDismiss as v,useFloating as y,useInteractions as b,useRole as x}from"@floating-ui/react";const S=n(null);function C(){let e=i(S);if(!e)throw Error(`useDropdown must be used within Dropdown`);return e}function w(){return i(S)}function T({className:t,children:n,onMouseDown:r,onClick:i,...a}){let{open:o,refs:s,floatingStyles:l,getFloatingProps:u,preserveFocus:f}=C();return o?c(d,{children:c(`div`,{"data-komc":!0,...u({...a,ref:s.setFloating,style:{...l,...a.style},className:e(`komc:z-50 komc:mt-0.5 komc:drop-shadow-md`,t),onMouseDown:e=>{f&&e.preventDefault(),r?.(e)},onClick:e=>{e.stopPropagation(),i?.(e)}}),children:n})}):null}function E({asChild:t=!0,className:n,type:r=`button`,...i}){let{open:a,refs:o,getReferenceProps:s}=C();return c(t?u:`button`,{"data-komc":!0,"data-state":a?`open`:`closed`,type:t?void 0:r,className:e(!t&&`komc:inline-flex komc:items-center komc:outline-none`,n),...s({...i,ref:o.setReference})})}function D({trigger:e,reference:n,children:i,placement:u=`bottom-start`,boundary:d,offset:C=8,maxWidth:w,maxHeight:D=300,className:O,open:k,onOpenChange:A,preserveFocus:j=!1,role:M=`menu`}){let N=k!==void 0,[P,F]=s(!1),I=N?k:P,L=r(e=>{N||F(e),A?.(e)},[N,A]),R=r(()=>L(!1),[L]);t(I,R,!1);let{refs:z,floatingStyles:B,context:V}=y({open:I,onOpenChange:L,placement:u,whileElementsMounted:f,middleware:o(()=>[m(C),p({boundary:d??void 0,padding:8}),h({boundary:d??void 0,padding:8}),g({boundary:d??void 0,padding:8,apply({availableHeight:e,availableWidth:t,elements:n}){let r={maxHeight:`${Math.min(e,D)}px`,overflowY:`auto`};w!=null&&(r.maxWidth=`${Math.min(t,w)}px`),Object.assign(n.floating.style,r)}})],[d,D,w,C])}),{getReferenceProps:H,getFloatingProps:U}=b([_(V),v(V,{escapeKey:!1}),x(V,{role:M})]);a(()=>{n&&z.setPositionReference(n)},[n,z]);let W=o(()=>({open:I,setOpen:L,close:R,refs:z,floatingStyles:B,getReferenceProps:H,getFloatingProps:U,preserveFocus:j}),[R,B,U,H,I,j,z,L]);return l(S.Provider,{value:W,children:[e?c(E,{asChild:!0,children:e}):null,e?c(T,{className:O,children:i}):i]})}export{D as Dropdown,T as DropdownContent,E as DropdownTrigger,C as useDropdown,w as useOptionalDropdown};
|
package/dist/ui/image/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-6KfzqI9Z.cjs`),require(`../../common-D4sUwkFd.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../skeleton-B5ZccRFX.cjs`);require(`../../api-client-C3o2pO0q.cjs`);const n=require(`../../use-subset-image-o_gmC1HL.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`clsx`);a=e.t(a);let o=require(`class-variance-authority`);const s=(0,o.cva)(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),c=(0,r.forwardRef)(({...e},t)=>{let{ref:r,imageProps:a}=n.n({ref:t,...e});return(0,i.jsx)(`img`,{ref:r,...a})}),l=(0,r.forwardRef)(({skeleton:e=!0,layout:r=`stretch`,fallbackSrc:o,className:c,emptyNode:l,emptyNodeClassName:d,skeletonClassName:f,...p},m)=>{let{ref:h,isLoad:g,isError:_,imageProps:v}=n.n({ref:m,fallbackSrc:o,forceLoad:!e,...p}),y=!p.fill&&r===`intrinsic`?{width:`${p.width}px`,height:`${p.height}px`}:void 0,b=(0,a.default)(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!p.fill&&r===`stretch`&&`komc:w-full komc:h-full`);return!o&&_&&l?p.fill?(0,i.jsx)(u,{className:d,children:l}):(0,i.jsx)(`div`,{"data-komc":!0,style:y,className:b,children:(0,i.jsx)(u,{className:d,children:l})}):p.fill?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`img`,{ref:h,...v,className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:invisible`:`komc:visible`,c)}),(0,i.jsx)(`div`,{"data-komc":!0,className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:(0,i.jsx)(t.t,{size:`full`,className:f})})]}):(0,i.jsxs)(`div`,{"data-komc":!0,style:y,className:b,children:[(0,i.jsx)(`img`,{ref:h,...v,className:(0,a.default)(s({fill:p.fill,className:c}),e&&!g?`komc:invisible`:`komc:visible`)}),(0,i.jsx)(`div`,{className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:(0,i.jsx)(t.t,{size:`full`,className:f})})]})}),u=({children:e,className:t})=>(0,i.jsx)(`div`,{"data-komc":!0,role:`alert`,className:(0,a.default)(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var d=l;exports.BaseImage=c,exports.EmptyNode=u,exports.Image=d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
1
|
+
import { i as UseSubsetImageProps, t as BaseProps } from "../../use-subset-image-bDB5TSd4.cjs";
|
|
2
|
+
import * as react1 from "react";
|
|
3
|
+
import * as react_jsx_runtime15 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: 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;
|
|
@@ -40,6 +40,6 @@ interface EmptyNodeProps {
|
|
|
40
40
|
declare const EmptyNode: ({
|
|
41
41
|
children,
|
|
42
42
|
className
|
|
43
|
-
}: EmptyNodeProps) =>
|
|
43
|
+
}: EmptyNodeProps) => react_jsx_runtime15.JSX.Element;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { BaseImage, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
1
|
+
import { i as UseSubsetImageProps, t as BaseProps } from "../../use-subset-image-Dygkyw-W.mjs";
|
|
2
|
+
import * as react1 from "react";
|
|
3
|
+
import * as react_jsx_runtime3 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: react1.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">) & 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: react2.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;
|
|
@@ -40,6 +40,6 @@ interface EmptyNodeProps {
|
|
|
40
40
|
declare const EmptyNode: ({
|
|
41
41
|
children,
|
|
42
42
|
className
|
|
43
|
-
}: EmptyNodeProps) =>
|
|
43
|
+
}: EmptyNodeProps) => react_jsx_runtime3.JSX.Element;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { BaseImage, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps };
|
package/dist/ui/image/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"../../src-
|
|
1
|
+
"use client";import"../../src-CIMlbgv1.mjs";import"../../common-ZUMpASnc.mjs";import"../../file-B-UJkabO.mjs";import{t as e}from"../../skeleton-Y22bmaaB.mjs";import"../../api-client-C0sbSOQf.mjs";import{n as t}from"../../use-subset-image-Df2fCrtH.mjs";import{forwardRef as n}from"react";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import o from"clsx";import{cva as s}from"class-variance-authority";const c=s(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),l=n(({...e},n)=>{let{ref:r,imageProps:a}=t({ref:n,...e});return i(`img`,{ref:r,...a})}),u=n(({skeleton:n=!0,layout:s=`stretch`,fallbackSrc:l,className:u,emptyNode:f,emptyNodeClassName:p,skeletonClassName:m,...h},g)=>{let{ref:_,isLoad:v,isError:y,imageProps:b}=t({ref:g,fallbackSrc:l,forceLoad:!n,...h}),x=!h.fill&&s===`intrinsic`?{width:`${h.width}px`,height:`${h.height}px`}:void 0,S=o(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!h.fill&&s===`stretch`&&`komc:w-full komc:h-full`);return!l&&y&&f?h.fill?i(d,{className:p,children:f}):i(`div`,{"data-komc":!0,style:x,className:S,children:i(d,{className:p,children:f})}):h.fill?a(r,{children:[i(`img`,{ref:_,...b,className:o(`komc:w-full komc:h-full komc:absolute komc:inset-0`,n&&!v?`komc:invisible`:`komc:visible`,u)}),i(`div`,{"data-komc":!0,className:o(`komc:w-full komc:h-full komc:absolute komc:inset-0`,n&&!v?`komc:block`:`komc:hidden`),children:i(e,{size:`full`,className:m})})]}):a(`div`,{"data-komc":!0,style:x,className:S,children:[i(`img`,{ref:_,...b,className:o(c({fill:h.fill,className:u}),n&&!v?`komc:invisible`:`komc:visible`)}),i(`div`,{className:o(`komc:w-full komc:h-full komc:absolute komc:inset-0`,n&&!v?`komc:block`:`komc:hidden`),children:i(e,{size:`full`,className:m})})]})}),d=({children:e,className:t})=>i(`div`,{"data-komc":!0,role:`alert`,className:o(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var f=u;export{l as BaseImage,d as EmptyNode,f as Image};
|
package/dist/ui/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../
|
|
1
|
+
require(`../common-D4sUwkFd.cjs`);const e=require(`../ui-Bs9PP9eC.cjs`),t=require(`../button-ChX3XGbR.cjs`),n=require(`../skeleton-B5ZccRFX.cjs`);exports.BottomAppBar=e.a,exports.Button=t.t,exports.ConditionalEitherWrapper=e.r,exports.ConditionalWrapper=e.i,exports.Input=e.n,exports.Skeleton=n.t,exports.StableText=e.t;
|