@machinerd/js-module 0.5.3 → 0.6.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.
Files changed (97) hide show
  1. package/README.md +10 -101
  2. package/dist/common-CQWUs1nE.cjs +1 -0
  3. package/dist/common-DbEp6YNc.mjs +1 -0
  4. package/dist/file-5mweNdAM.cjs +1 -0
  5. package/dist/file-DShNxIW4.mjs +1 -0
  6. package/dist/hooks/index.cjs +1 -1
  7. package/dist/hooks/index.d.cts +1 -1
  8. package/dist/hooks/index.d.mts +1 -1
  9. package/dist/hooks/index.mjs +1 -1
  10. package/dist/hooks--O5RcEJq.cjs +1 -0
  11. package/dist/hooks-C9rXWkfW.mjs +1 -0
  12. package/dist/{index-ComhjQ-q.d.cts → index-BFHrNSKP.d.mts} +4 -4
  13. package/dist/{index-ByfkW7VU.d.mts → index-BQHtVz_S.d.cts} +4 -4
  14. package/dist/index.d.cts +1 -1
  15. package/dist/index.d.mts +1 -1
  16. package/dist/index.mjs +1 -1
  17. package/dist/providers/index.cjs +1 -1
  18. package/dist/providers/index.d.cts +3 -3
  19. package/dist/providers/index.d.mts +3 -3
  20. package/dist/providers/index.mjs +1 -1
  21. package/dist/{providers-5JCPezAS.mjs → providers-zftmvT1z.mjs} +1 -1
  22. package/dist/skeleton-6QtpIO7l.mjs +1 -0
  23. package/dist/skeleton-DBha34Cx.cjs +1 -0
  24. package/dist/styles/index.css +6 -25
  25. package/dist/ui/carousel/index.cjs +1 -0
  26. package/dist/ui/carousel/index.d.cts +95 -0
  27. package/dist/ui/carousel/index.d.mts +95 -0
  28. package/dist/ui/carousel/index.mjs +1 -0
  29. package/dist/ui/dialog/index.cjs +1 -0
  30. package/dist/ui/dialog/index.d.cts +30 -0
  31. package/dist/ui/dialog/index.d.mts +30 -0
  32. package/dist/ui/dialog/index.mjs +1 -0
  33. package/dist/ui/image/index.cjs +1 -0
  34. package/dist/ui/image/index.d.cts +45 -0
  35. package/dist/ui/image/index.d.mts +45 -0
  36. package/dist/ui/image/index.mjs +1 -0
  37. package/dist/ui/index.cjs +1 -1
  38. package/dist/ui/index.d.cts +9 -9
  39. package/dist/ui/index.d.mts +9 -9
  40. package/dist/ui/index.mjs +1 -1
  41. package/dist/ui/sheet/index.cjs +1 -0
  42. package/dist/ui/sheet/index.d.cts +28 -0
  43. package/dist/ui/sheet/index.d.mts +28 -0
  44. package/dist/ui/sheet/index.mjs +1 -0
  45. package/dist/ui/tooltip/index.cjs +1 -0
  46. package/dist/ui/tooltip/index.d.cts +16 -0
  47. package/dist/ui/tooltip/index.d.mts +16 -0
  48. package/dist/ui/tooltip/index.mjs +1 -0
  49. package/dist/use-subset-image-DhX5WmYG.cjs +1 -0
  50. package/dist/use-subset-image-DvV5Mlkc.mjs +1 -0
  51. package/dist/util/browser.cjs +1 -0
  52. package/dist/util/browser.d.cts +16 -0
  53. package/dist/util/browser.d.mts +16 -0
  54. package/dist/util/browser.mjs +1 -0
  55. package/dist/util/common.cjs +1 -0
  56. package/dist/util/common.d.cts +56 -0
  57. package/dist/util/common.d.mts +56 -0
  58. package/dist/util/common.mjs +1 -0
  59. package/dist/util/date.cjs +1 -0
  60. package/dist/util/date.d.cts +4 -0
  61. package/dist/util/date.d.mts +6 -0
  62. package/dist/util/date.mjs +1 -0
  63. package/dist/util/file.cjs +1 -0
  64. package/dist/util/file.d.cts +15 -0
  65. package/dist/util/file.d.mts +15 -0
  66. package/dist/util/file.mjs +1 -0
  67. package/dist/util/format.cjs +1 -0
  68. package/dist/util/format.d.cts +6 -0
  69. package/dist/util/format.d.mts +6 -0
  70. package/dist/util/format.mjs +1 -0
  71. package/dist/util/generator.cjs +1 -0
  72. package/dist/util/generator.d.cts +18 -0
  73. package/dist/util/generator.d.mts +18 -0
  74. package/dist/util/generator.mjs +1 -0
  75. package/dist/util/phone.cjs +1 -0
  76. package/dist/util/phone.d.cts +22 -0
  77. package/dist/util/phone.d.mts +22 -0
  78. package/dist/util/phone.mjs +1 -0
  79. package/package.json +48 -8
  80. package/dist/hooks-DBo6LQrH.mjs +0 -1
  81. package/dist/hooks-DqgWx1Fa.cjs +0 -1
  82. package/dist/skeleton-S6S1ZnCy.mjs +0 -1
  83. package/dist/skeleton-g6yXh6D9.cjs +0 -1
  84. package/dist/ui-client/index.cjs +0 -1
  85. package/dist/ui-client/index.d.cts +0 -192
  86. package/dist/ui-client/index.d.mts +0 -192
  87. package/dist/ui-client/index.mjs +0 -1
  88. package/dist/util/index.cjs +0 -1
  89. package/dist/util/index.d.cts +0 -129
  90. package/dist/util/index.d.mts +0 -130
  91. package/dist/util/index.mjs +0 -1
  92. package/dist/util-o7fjt7iK.cjs +0 -1
  93. package/dist/util-zXJA6Gnc.mjs +0 -1
  94. /package/dist/{index-CH1uVFqx.d.cts → index-B3fFA21M.d.mts} +0 -0
  95. /package/dist/{index-D6Jzsxc-.d.mts → index-CeiAF-WU.d.cts} +0 -0
  96. /package/dist/{providers-BNK8Fisc.cjs → providers-CkXkdYcB.cjs} +0 -0
  97. /package/dist/{src-C_FmOyer.mjs → src-CukOR3K2.mjs} +0 -0
@@ -0,0 +1,95 @@
1
+ import React, { ComponentProps } from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
4
+
5
+ //#region src/ui/carousel/carousel-context.d.ts
6
+ type CarouselApi = UseEmblaCarouselType[1];
7
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
8
+ type CarouselOptions = UseCarouselParameters[0];
9
+ type CarouselPlugin = UseCarouselParameters[1];
10
+ interface CarouselProps {
11
+ options?: CarouselOptions;
12
+ plugins?: CarouselPlugin;
13
+ orientation?: 'horizontal' | 'vertical';
14
+ setApi?: (api: CarouselApi) => void;
15
+ }
16
+ type CarouselContextProps = {
17
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0];
18
+ api: ReturnType<typeof useEmblaCarousel>[1];
19
+ scrollPrev: () => void;
20
+ scrollNext: () => void;
21
+ canScrollPrev: boolean;
22
+ canScrollNext: boolean;
23
+ scrollTo: (index: number) => void;
24
+ dots: number;
25
+ selectedScrollSnap: number;
26
+ } & CarouselProps;
27
+ //#endregion
28
+ //#region src/ui/carousel/carousel.d.ts
29
+ interface CarouselProps$1 extends ComponentProps<'div'>, CarouselProps {
30
+ orientation?: 'horizontal' | 'vertical';
31
+ options?: CarouselProps['options'];
32
+ setApi?: CarouselProps['setApi'];
33
+ plugins?: CarouselProps['plugins'];
34
+ }
35
+ declare function Carousel({
36
+ orientation,
37
+ options,
38
+ setApi,
39
+ plugins,
40
+ className,
41
+ children,
42
+ ...props
43
+ }: CarouselProps$1): react_jsx_runtime0.JSX.Element;
44
+ //#endregion
45
+ //#region src/ui/carousel/carousel-viewport.d.ts
46
+ declare function CarouselViewport({
47
+ children,
48
+ className,
49
+ ...props
50
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
51
+ //#endregion
52
+ //#region src/ui/carousel/carousel-wrapper.d.ts
53
+ declare function CarouselWrapper({
54
+ className,
55
+ ...props
56
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
57
+ //#endregion
58
+ //#region src/ui/carousel/carousel-item.d.ts
59
+ declare function CarouselItem({
60
+ className,
61
+ ...props
62
+ }: React.ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
63
+ //#endregion
64
+ //#region src/ui/carousel/carousel-previous.d.ts
65
+ declare function CarouselPrevious({
66
+ children,
67
+ className,
68
+ ...props
69
+ }: React.ComponentProps<'button'>): react_jsx_runtime0.JSX.Element;
70
+ //#endregion
71
+ //#region src/ui/carousel/carousel-next.d.ts
72
+ declare function CarouselNext({
73
+ children,
74
+ className,
75
+ ...props
76
+ }: React.ComponentProps<'button'>): react_jsx_runtime0.JSX.Element;
77
+ //#endregion
78
+ //#region src/ui/carousel/carousel-dots.d.ts
79
+ declare function CarouselDots$1({
80
+ children,
81
+ ...props
82
+ }: Omit<React.ComponentProps<'button'>, 'children'> & {
83
+ children?: (index: number) => React.ReactNode;
84
+ }): react_jsx_runtime0.JSX.Element;
85
+ //#endregion
86
+ //#region src/ui/carousel/carousel-dot.d.ts
87
+ declare function CarouselDots({
88
+ index,
89
+ children,
90
+ ...props
91
+ }: React.ComponentProps<'button'> & {
92
+ index: number;
93
+ }): react_jsx_runtime0.JSX.Element;
94
+ //#endregion
95
+ export { Carousel, type CarouselApi, type CarouselContextProps, CarouselDots as CarouselDot, CarouselDots$1 as CarouselDots, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselViewport, CarouselWrapper };
@@ -0,0 +1 @@
1
+ "use client";import{n as e}from"../../common-DbEp6YNc.mjs";import t from"clsx";import n,{useCallback as r,useEffect as i,useState as a}from"react";import{Fragment as o,jsx as s}from"react/jsx-runtime";import c from"embla-carousel-react";const l=n.createContext(null);function u(){let e=n.useContext(l);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function d({orientation:t=`horizontal`,options:n,setApi:o,plugins:u,className:d,children:f,...p}){let[m,h]=c({...n,axis:t===`horizontal`?`x`:`y`},u),[g,_]=a(!1),[v,y]=a(!1),[b,x]=a(0),[S,C]=a(0),w=r(e=>{e&&(_(e.canScrollPrev()),y(e.canScrollNext()),C(e.selectedScrollSnap()))},[]),T=r(()=>{h?.scrollPrev()},[h]),E=r(()=>{h?.scrollNext()},[h]),D=r(e=>{h?.scrollTo(e)},[h]),O=r(()=>{x(h?.scrollSnapList().length||0)},[h]),k=r(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 i(()=>{!h||!o||o(h)},[h,o]),i(()=>{if(h)return w(h),O(),h.on(`reInit`,O),h.on(`reInit`,w),h.on(`select`,w),()=>{h?.off(`select`,w)}},[h,w]),s(l.Provider,{value:{carouselRef:m,api:h,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:T,scrollNext:E,canScrollPrev:g,canScrollNext:v,scrollTo:D,dots:b,selectedScrollSnap:S},children:s(`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 s(`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 s(`div`,{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 s(`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:n,...r}){let{scrollPrev:i,canScrollPrev:a}=u();return s(`button`,{type:`button`,"data-komc":!0,disabled:!a,"aria-label":`previous slide`,className:t(`komc:w-full`,n),onClick:i,...r,children:e})}function g({children:e,className:n,...r}){let{scrollNext:i,canScrollNext:a}=u();return s(`button`,{type:`button`,"data-komc":!0,disabled:!a,"aria-label":`next slide`,className:t(`komc:w-full`,n),onClick:i,...r,children:e})}function _({children:e,...t}){let{dots:n,selectedScrollSnap:r,scrollTo:i}=u();return s(o,{children:Array.from({length:n}).map((n,a)=>s(`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 s(`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};
@@ -0,0 +1 @@
1
+ "use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../hooks--O5RcEJq.cjs`);require(`../../providers-CkXkdYcB.cjs`),require(`../../use-subset-image-DhX5WmYG.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;
@@ -0,0 +1,30 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
3
+ import * as class_variance_authority_types0 from "class-variance-authority/types";
4
+ import { VariantProps } from "class-variance-authority";
5
+
6
+ //#region src/ui/dialog/dialog.d.ts
7
+ declare const classes: (props?: ({
8
+ padding?: "sm" | "md" | "lg" | "none" | null | undefined;
9
+ maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
10
+ } & class_variance_authority_types0.ClassProp) | undefined) => string;
11
+ interface DialogProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
12
+ closeOnBackdropClick?: boolean;
13
+ isOpen: boolean;
14
+ zIndex?: number;
15
+ onClose: () => void;
16
+ children: ReactNode;
17
+ }
18
+ declare function Dialog({
19
+ closeOnBackdropClick,
20
+ isOpen,
21
+ zIndex,
22
+ padding,
23
+ maxWidth,
24
+ className,
25
+ onClose,
26
+ children,
27
+ ...rest
28
+ }: DialogProps): react_jsx_runtime9.JSX.Element | null;
29
+ //#endregion
30
+ export { Dialog, type DialogProps };
@@ -0,0 +1,30 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
3
+ import { VariantProps } from "class-variance-authority";
4
+ import * as class_variance_authority_types0 from "class-variance-authority/types";
5
+
6
+ //#region src/ui/dialog/dialog.d.ts
7
+ declare const classes: (props?: ({
8
+ padding?: "sm" | "md" | "lg" | "none" | null | undefined;
9
+ maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
10
+ } & class_variance_authority_types0.ClassProp) | undefined) => string;
11
+ interface DialogProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
12
+ closeOnBackdropClick?: boolean;
13
+ isOpen: boolean;
14
+ zIndex?: number;
15
+ onClose: () => void;
16
+ children: ReactNode;
17
+ }
18
+ declare function Dialog({
19
+ closeOnBackdropClick,
20
+ isOpen,
21
+ zIndex,
22
+ padding,
23
+ maxWidth,
24
+ className,
25
+ onClose,
26
+ children,
27
+ ...rest
28
+ }: DialogProps): react_jsx_runtime8.JSX.Element | null;
29
+ //#endregion
30
+ export { Dialog, type DialogProps };
@@ -0,0 +1 @@
1
+ "use client";import"../../src-CukOR3K2.mjs";import"../../file-DShNxIW4.mjs";import{o as e}from"../../hooks-C9rXWkfW.mjs";import"../../providers-zftmvT1z.mjs";import"../../use-subset-image-DvV5Mlkc.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};
@@ -0,0 +1 @@
1
+ "use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`),require(`../../common-CQWUs1nE.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../skeleton-DBha34Cx.cjs`);require(`../../providers-CkXkdYcB.cjs`);const n=require(`../../use-subset-image-DhX5WmYG.cjs`);let r=require(`clsx`);r=e.t(r);let i=require(`react`),a=require(`react/jsx-runtime`),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,i.forwardRef)(({...e},t)=>{let{ref:r,imageProps:i}=n.n({ref:t,...e});return(0,a.jsx)(`img`,{ref:r,...i})}),l=(0,i.forwardRef)(({skeleton:e=!0,layout:i=`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&&i===`intrinsic`?{width:`${p.width}px`,height:`${p.height}px`}:void 0,b=(0,r.default)(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!p.fill&&i===`stretch`&&`komc:w-full komc:h-full`);return!o&&_&&l?p.fill?(0,a.jsx)(u,{className:d,children:l}):(0,a.jsx)(`div`,{"data-komc":!0,style:y,className:b,children:(0,a.jsx)(u,{className:d,children:l})}):p.fill?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`img`,{ref:h,...v,className:(0,r.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:invisible`:`komc:visible`,c)}),(0,a.jsx)(`div`,{"data-komc":!0,className:(0,r.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:(0,a.jsx)(t.t,{size:`full`,className:f})})]}):(0,a.jsxs)(`div`,{"data-komc":!0,style:y,className:b,children:[(0,a.jsx)(`img`,{ref:h,...v,className:(0,r.default)(s({fill:p.fill,className:c}),e&&!g?`komc:invisible`:`komc:visible`)}),(0,a.jsx)(`div`,{className:(0,r.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:(0,a.jsx)(t.t,{size:`full`,className:f})})]})}),u=({children:e,className:t})=>(0,a.jsx)(`div`,{"data-komc":!0,role:`alert`,className:(0,r.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;
@@ -0,0 +1,45 @@
1
+ import { a as UseSubsetImageProps, n as BaseProps } from "../../index-BQHtVz_S.cjs";
2
+ import * as react3 from "react";
3
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
4
+
5
+ //#region src/ui/image/image.d.ts
6
+ type ImageSubsetProps = {
7
+ layout?: 'intrinsic' | 'stretch';
8
+ skeleton?: boolean;
9
+ emptyNode?: React.ReactNode;
10
+ emptyNodeClassName?: string;
11
+ skeletonClassName?: string;
12
+ };
13
+ type ImageProps = UseSubsetImageProps & ImageSubsetProps;
14
+ declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
15
+ fill: true;
16
+ sizes: string;
17
+ width?: never;
18
+ height?: never;
19
+ }, "ref"> | Omit<BaseProps & {
20
+ fill?: false;
21
+ sizes?: never;
22
+ width: number;
23
+ height: number;
24
+ }, "ref">) & react3.RefAttributes<HTMLImageElement>>;
25
+ declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
26
+ fill: true;
27
+ sizes: string;
28
+ width?: never;
29
+ height?: never;
30
+ } & ImageSubsetProps, "ref"> | Omit<BaseProps & {
31
+ fill?: false;
32
+ sizes?: never;
33
+ width: number;
34
+ height: number;
35
+ } & ImageSubsetProps, "ref">) & react3.RefAttributes<HTMLImageElement>>;
36
+ interface EmptyNodeProps {
37
+ children: React.ReactNode;
38
+ className?: string;
39
+ }
40
+ declare const EmptyNode: ({
41
+ children,
42
+ className
43
+ }: EmptyNodeProps) => react_jsx_runtime8.JSX.Element;
44
+ //#endregion
45
+ export { BaseImage, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps };
@@ -0,0 +1,45 @@
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
+
5
+ //#region src/ui/image/image.d.ts
6
+ type ImageSubsetProps = {
7
+ layout?: 'intrinsic' | 'stretch';
8
+ skeleton?: boolean;
9
+ emptyNode?: React.ReactNode;
10
+ emptyNodeClassName?: string;
11
+ skeletonClassName?: string;
12
+ };
13
+ type ImageProps = UseSubsetImageProps & ImageSubsetProps;
14
+ declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
15
+ fill: true;
16
+ sizes: string;
17
+ width?: never;
18
+ height?: never;
19
+ }, "ref"> | Omit<BaseProps & {
20
+ fill?: false;
21
+ sizes?: never;
22
+ width: number;
23
+ height: number;
24
+ }, "ref">) & react3.RefAttributes<HTMLImageElement>>;
25
+ declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
26
+ fill: true;
27
+ sizes: string;
28
+ width?: never;
29
+ height?: never;
30
+ } & ImageSubsetProps, "ref"> | Omit<BaseProps & {
31
+ fill?: false;
32
+ sizes?: never;
33
+ width: number;
34
+ height: number;
35
+ } & ImageSubsetProps, "ref">) & react3.RefAttributes<HTMLImageElement>>;
36
+ interface EmptyNodeProps {
37
+ children: React.ReactNode;
38
+ className?: string;
39
+ }
40
+ declare const EmptyNode: ({
41
+ children,
42
+ className
43
+ }: EmptyNodeProps) => react_jsx_runtime9.JSX.Element;
44
+ //#endregion
45
+ export { BaseImage, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps };
@@ -0,0 +1 @@
1
+ "use client";import"../../src-CukOR3K2.mjs";import"../../common-DbEp6YNc.mjs";import"../../file-DShNxIW4.mjs";import{t as e}from"../../skeleton-6QtpIO7l.mjs";import"../../providers-zftmvT1z.mjs";import{n as t}from"../../use-subset-image-DvV5Mlkc.mjs";import n from"clsx";import{forwardRef as r}from"react";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";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=r(({...e},n)=>{let{ref:r,imageProps:i}=t({ref:n,...e});return a(`img`,{ref:r,...i})}),u=r(({skeleton:r=!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:!r,...h}),x=!h.fill&&s===`intrinsic`?{width:`${h.width}px`,height:`${h.height}px`}:void 0,S=n(`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?a(d,{className:p,children:f}):a(`div`,{"data-komc":!0,style:x,className:S,children:a(d,{className:p,children:f})}):h.fill?o(i,{children:[a(`img`,{ref:_,...b,className:n(`komc:w-full komc:h-full komc:absolute komc:inset-0`,r&&!v?`komc:invisible`:`komc:visible`,u)}),a(`div`,{"data-komc":!0,className:n(`komc:w-full komc:h-full komc:absolute komc:inset-0`,r&&!v?`komc:block`:`komc:hidden`),children:a(e,{size:`full`,className:m})})]}):o(`div`,{"data-komc":!0,style:x,className:S,children:[a(`img`,{ref:_,...b,className:n(c({fill:h.fill,className:u}),r&&!v?`komc:invisible`:`komc:visible`)}),a(`div`,{className:n(`komc:w-full komc:h-full komc:absolute komc:inset-0`,r&&!v?`komc:block`:`komc:hidden`),children:a(e,{size:`full`,className:m})})]})}),d=({children:e,className:t})=>a(`div`,{"data-komc":!0,role:`alert`,className:n(`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(`../chunk-Bmb41Sf3.cjs`),t=require(`../util-o7fjt7iK.cjs`),n=require(`../skeleton-g6yXh6D9.cjs`);let r=require(`clsx`);r=e.t(r);let i=require(`react`);i=e.t(i);let a=require(`react/jsx-runtime`),o=require(`class-variance-authority`),s=require(`@radix-ui/react-slot`);function c({className:e,items:t,render:n,...o}){return(0,a.jsx)(`nav`,{"data-komc":!0,"aria-label":`bottom app bar`,className:(0,r.default)(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...o,children:(0,a.jsx)(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>(0,a.jsx)(i.default.Fragment,{children:n(e)},t))})})}const l=(0,o.cva)(t.y(`komc:flex komc:justify-center komc:items-center komc:gap-x-2 komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:[&_svg]:transition-colors komc:[&_svg]:duration-200`,`komc:cursor-pointer komc:disabled:cursor-default`),{variants:{size:{xxs:`komc:h-7.5`,xs:`komc:h-8`,sm:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`,"4xl":`komc:h-15`},shadow:{none:``,sm:`komc:drop-shadow-sm`,md:`komc:drop-shadow-md`,lg:`komc:drop-shadow-lg`,xl:`komc:drop-shadow-xl`,"2xl":`komc:drop-shadow-2xl`,"3xl":`komc:drop-shadow-3xl`},outline:{line:`komc:border`,solid:`komc:border komc:border-transparent`,clear:`komc:border-none`},variant:{blue:``,duo:``,white:``,gray:``,neutral:``,night:``,black:``,sky:``,"sky-blue":``,indigo:``},px:{none:`komc:px-0`,xs:`komc:px-0.5`,sm:`komc:px-1`,md:`komc:px-1.5`,lg:`komc:px-2`,xl:`komc:px-3`,"2xl":`komc:px-4`,"3xl":`komc:px-5`,"4xl":`komc:px-6`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},compoundVariants:[{outline:`line`,variant:`blue`,className:t.y(`komc:border-blue-500 komc:bg-white komc:text-blue-500`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`duo`,className:t.y(`komc:border-blue-500 komc:bg-white komc:text-brand-blck`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`white`,className:t.y(`komc:border-gray-600 komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200 komc:hover:text-brand-blck`,`komc:active:bg-gray-200 komc:active:text-brand-blck`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`gray`,className:t.y(`komc:border-white komc:bg-transparent komc:text-white`,`komc:hover:bg-[rgb(199,199,199)] komc:hover:text-white`,`komc:active:bg-[rgb(199,199,199)] komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`neutral`,className:t.y(`komc:border-gray-800 komc:bg-transparent komc:text-black`,`komc:hover:bg-gray-200 komc:hover:text-black`,`komc:active:bg-gray-200 komc:active:text-black`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky`,className:t.y(`komc:border-sky-750 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-750 komc:hover:text-white`,`komc:active:bg-sky-750 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky-blue`,className:t.y(`komc:border-sky-450 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-450 komc:hover:text-white`,`komc:active:bg-sky-450 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`solid`,variant:`white`,className:t.y(`komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200`,`komc:active:bg-gray-200`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`gray`,className:t.y(`komc:bg-gray-100 komc:text-blue-500`,`komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`blue`,className:t.y(`komc:bg-blue-500 komc:text-white`,`komc:hover:bg-night-700 komc:hover:text-white`,`komc:active:bg-night-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`night`,className:t.y(`komc:bg-night-700 komc:text-white`,`komc:hover:bg-night-800 komc:hover:text-white`,`komc:active:bg-night-800 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`black`,className:t.y(`komc:bg-[rgb(95,95,96)] komc:text-white`,`komc:hover:bg-[rgb(76,76,77)] komc:hover:text-white`,`komc:active:bg-[rgb(76,76,77)] komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`sky`,className:t.y(`komc:bg-sky-750 komc:text-white`,`komc:hover:bg-sky-950 komc:hover:text-white`,`komc:active:bg-sky-950 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`sky-blue`,className:t.y(`komc:bg-sky-450 komc:text-white`,`komc:hover:bg-sky-650 komc:hover:text-white`,`komc:active:bg-sky-650 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`indigo`,className:t.y(`komc:bg-indigo-600 komc:text-white`,`komc:hover:bg-indigo-700 komc:hover:text-white`,`komc:active:bg-indigo-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`clear`,variant:`sky`,className:t.y(`komc:bg-transparent komc:text-[#1890FF]`,`komc:hover:bg-transparent komc:hover:text-[#1890FF] komc:hover:underline`,`komc:active:bg-transparent komc:active:text-[#1890FF] komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`clear`,variant:`gray`,className:t.y(`komc:bg-transparent komc:text-gray-800`,`komc:hover:bg-transparent komc:hover:text-gray-800 komc:hover:underline`,`komc:active:bg-transparent komc:active:text-gray-800 komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)}],defaultVariants:{size:`md`,shadow:`none`,outline:`line`,variant:`blue`,px:`2xl`,rounded:`sm`}}),u=(0,i.forwardRef)(({type:e=`button`,className:t,id:n,size:r,shadow:i,outline:o,variant:c,px:u,rounded:d,asChild:f,...p},m)=>(0,a.jsx)(f?s.Slot:`button`,{ref:m,...p,type:e,id:n,className:l({size:r,shadow:i,outline:o,variant:c,px:u,rounded:d,className:t})}));var d=u;function f({condition:e,wrapper:t,children:n}){return e?t(n):n}const p=(0,o.cva)(t.y(`komc:flex komc:items-center komc:w-full komc:px-2`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:h-full`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}}),m=(0,i.forwardRef)(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:o=`lg`,className:s,...c},l)=>(0,a.jsxs)(`div`,{"data-komc":!0,className:p({size:n,gap:r,outline:i,rounded:o,className:s}),children:[e,(0,a.jsx)(`input`,{ref:l,type:`text`,...c}),t]}));var h=m;function g({children:e,className:t,...n}){return(0,a.jsx)(`span`,{...n,"data-komc":!0,"data-text":`${e}`,className:(0,r.default)(`komc:inline-flex komc:flex-col komc:justify-center komc:items-center`,`komc:after:content-[attr(data-text)] komc:after:font-bold`,`komc:after:h-0 komc:after:invisible komc:after:overflow-hidden`,`komc:after:select-none komc:after:pointer-events-none`,t),children:e})}exports.BottomAppBar=c,exports.Button=d,exports.ConditionalWrapper=f,exports.Input=h,exports.Skeleton=n.t,exports.StableText=g;
1
+ const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../common-CQWUs1nE.cjs`),n=require(`../skeleton-DBha34Cx.cjs`);let r=require(`clsx`);r=e.t(r);let i=require(`react`);i=e.t(i);let a=require(`react/jsx-runtime`),o=require(`class-variance-authority`),s=require(`@radix-ui/react-slot`);function c({className:e,items:t,render:n,...o}){return(0,a.jsx)(`nav`,{"data-komc":!0,"aria-label":`bottom app bar`,className:(0,r.default)(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...o,children:(0,a.jsx)(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>(0,a.jsx)(i.default.Fragment,{children:n(e)},t))})})}const l=(0,o.cva)(t.n(`komc:flex komc:justify-center komc:items-center komc:gap-x-2 komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:[&_svg]:transition-colors komc:[&_svg]:duration-200`,`komc:cursor-pointer komc:disabled:cursor-default`),{variants:{size:{xxs:`komc:h-7.5`,xs:`komc:h-8`,sm:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`,"4xl":`komc:h-15`},shadow:{none:``,sm:`komc:drop-shadow-sm`,md:`komc:drop-shadow-md`,lg:`komc:drop-shadow-lg`,xl:`komc:drop-shadow-xl`,"2xl":`komc:drop-shadow-2xl`,"3xl":`komc:drop-shadow-3xl`},outline:{line:`komc:border`,solid:`komc:border komc:border-transparent`,clear:`komc:border-none`},variant:{blue:``,duo:``,white:``,gray:``,neutral:``,night:``,black:``,sky:``,"sky-blue":``,indigo:``},px:{none:`komc:px-0`,xs:`komc:px-0.5`,sm:`komc:px-1`,md:`komc:px-1.5`,lg:`komc:px-2`,xl:`komc:px-3`,"2xl":`komc:px-4`,"3xl":`komc:px-5`,"4xl":`komc:px-6`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},compoundVariants:[{outline:`line`,variant:`blue`,className:t.n(`komc:border-blue-500 komc:bg-white komc:text-blue-500`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`duo`,className:t.n(`komc:border-blue-500 komc:bg-white komc:text-brand-blck`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`white`,className:t.n(`komc:border-gray-600 komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200 komc:hover:text-brand-blck`,`komc:active:bg-gray-200 komc:active:text-brand-blck`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`gray`,className:t.n(`komc:border-white komc:bg-transparent komc:text-white`,`komc:hover:bg-[rgb(199,199,199)] komc:hover:text-white`,`komc:active:bg-[rgb(199,199,199)] komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`neutral`,className:t.n(`komc:border-gray-800 komc:bg-transparent komc:text-black`,`komc:hover:bg-gray-200 komc:hover:text-black`,`komc:active:bg-gray-200 komc:active:text-black`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky`,className:t.n(`komc:border-sky-750 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-750 komc:hover:text-white`,`komc:active:bg-sky-750 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky-blue`,className:t.n(`komc:border-sky-450 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-450 komc:hover:text-white`,`komc:active:bg-sky-450 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`solid`,variant:`white`,className:t.n(`komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200`,`komc:active:bg-gray-200`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`gray`,className:t.n(`komc:bg-gray-100 komc:text-blue-500`,`komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`blue`,className:t.n(`komc:bg-blue-500 komc:text-white`,`komc:hover:bg-night-700 komc:hover:text-white`,`komc:active:bg-night-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`night`,className:t.n(`komc:bg-night-700 komc:text-white`,`komc:hover:bg-night-800 komc:hover:text-white`,`komc:active:bg-night-800 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`black`,className:t.n(`komc:bg-[rgb(95,95,96)] komc:text-white`,`komc:hover:bg-[rgb(76,76,77)] komc:hover:text-white`,`komc:active:bg-[rgb(76,76,77)] komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`sky`,className:t.n(`komc:bg-sky-750 komc:text-white`,`komc:hover:bg-sky-950 komc:hover:text-white`,`komc:active:bg-sky-950 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`sky-blue`,className:t.n(`komc:bg-sky-450 komc:text-white`,`komc:hover:bg-sky-650 komc:hover:text-white`,`komc:active:bg-sky-650 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`indigo`,className:t.n(`komc:bg-indigo-600 komc:text-white`,`komc:hover:bg-indigo-700 komc:hover:text-white`,`komc:active:bg-indigo-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`clear`,variant:`sky`,className:t.n(`komc:bg-transparent komc:text-[#1890FF]`,`komc:hover:bg-transparent komc:hover:text-[#1890FF] komc:hover:underline`,`komc:active:bg-transparent komc:active:text-[#1890FF] komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`clear`,variant:`gray`,className:t.n(`komc:bg-transparent komc:text-gray-800`,`komc:hover:bg-transparent komc:hover:text-gray-800 komc:hover:underline`,`komc:active:bg-transparent komc:active:text-gray-800 komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)}],defaultVariants:{size:`md`,shadow:`none`,outline:`line`,variant:`blue`,px:`2xl`,rounded:`sm`}}),u=(0,i.forwardRef)(({type:e=`button`,className:t,id:n,size:r,shadow:i,outline:o,variant:c,px:u,rounded:d,asChild:f,...p},m)=>(0,a.jsx)(f?s.Slot:`button`,{ref:m,...p,type:e,id:n,className:l({size:r,shadow:i,outline:o,variant:c,px:u,rounded:d,className:t})}));var d=u;function f({condition:e,wrapper:t,children:n}){return e?t(n):n}const p=(0,o.cva)(t.n(`komc:flex komc:items-center komc:w-full komc:px-2`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:h-full`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}}),m=(0,i.forwardRef)(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:o=`lg`,className:s,...c},l)=>(0,a.jsxs)(`div`,{"data-komc":!0,className:p({size:n,gap:r,outline:i,rounded:o,className:s}),children:[e,(0,a.jsx)(`input`,{ref:l,type:`text`,...c}),t]}));var h=m;function g({children:e,className:t,...n}){return(0,a.jsx)(`span`,{...n,"data-komc":!0,"data-text":`${e}`,className:(0,r.default)(`komc:inline-flex komc:flex-col komc:justify-center komc:items-center`,`komc:after:content-[attr(data-text)] komc:after:font-bold`,`komc:after:h-0 komc:after:invisible komc:after:overflow-hidden`,`komc:after:select-none komc:after:pointer-events-none`,t),children:e})}exports.BottomAppBar=c,exports.Button=d,exports.ConditionalWrapper=f,exports.Input=h,exports.Skeleton=n.t,exports.StableText=g;
@@ -1,6 +1,6 @@
1
1
  import * as react10 from "react";
2
2
  import React$1, { ComponentProps, HTMLAttributes } from "react";
3
- import * as react_jsx_runtime4 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
4
4
  import * as class_variance_authority_types2 from "class-variance-authority/types";
5
5
  import { VariantProps } from "class-variance-authority";
6
6
 
@@ -19,11 +19,11 @@ declare function BottomAppBar<T>({
19
19
  //#region src/ui/button/button.d.ts
20
20
  declare const classes$2: (props?: ({
21
21
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "xxs" | "4xl" | null | undefined;
22
- shadow?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
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
- px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
26
- rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
25
+ px?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
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';
@@ -75,9 +75,9 @@ declare function ConditionalWrapper({
75
75
  //#region src/ui/input/input.d.ts
76
76
  declare const classes$1: (props?: ({
77
77
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "base" | "3xl" | null | undefined;
78
- gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
78
+ gap?: "sm" | "md" | "lg" | "none" | "xl" | "xs" | null | undefined;
79
79
  outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
80
- rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
80
+ rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | null | undefined;
81
81
  } & class_variance_authority_types2.ClassProp) | undefined) => string;
82
82
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
83
83
  size?: VariantProps<typeof classes$1>['size'];
@@ -92,7 +92,7 @@ declare const Input: react10.ForwardRefExoticComponent<InputProps & react10.RefA
92
92
  //#region src/ui/skeleton/skeleton.d.ts
93
93
  declare const classes: (props?: ({
94
94
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
95
- rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
95
+ rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
96
96
  } & class_variance_authority_types2.ClassProp) | undefined) => string;
97
97
  interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
98
98
  width?: string | number;
@@ -107,7 +107,7 @@ declare function Skeleton({
107
107
  height,
108
108
  className,
109
109
  ...props
110
- }: SkeletonProps): react_jsx_runtime4.JSX.Element;
110
+ }: SkeletonProps): react_jsx_runtime11.JSX.Element;
111
111
  //#endregion
112
112
  //#region src/ui/stable-text/stable-text.d.ts
113
113
  declare function StableText({
@@ -116,6 +116,6 @@ declare function StableText({
116
116
  ...props
117
117
  }: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
118
118
  children: string | number;
119
- }): react_jsx_runtime4.JSX.Element;
119
+ }): react_jsx_runtime11.JSX.Element;
120
120
  //#endregion
121
121
  export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
@@ -1,6 +1,6 @@
1
1
  import * as react10 from "react";
2
2
  import React$1, { ComponentProps, HTMLAttributes } from "react";
3
- import * as react_jsx_runtime11 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
  import * as class_variance_authority_types1 from "class-variance-authority/types";
6
6
 
@@ -19,11 +19,11 @@ declare function BottomAppBar<T>({
19
19
  //#region src/ui/button/button.d.ts
20
20
  declare const classes$2: (props?: ({
21
21
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "xxs" | "4xl" | null | undefined;
22
- shadow?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
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
- px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
26
- rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
25
+ px?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
26
+ rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
27
27
  } & class_variance_authority_types1.ClassProp) | undefined) => string;
28
28
  interface VariantMap {
29
29
  line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
@@ -75,9 +75,9 @@ declare function ConditionalWrapper({
75
75
  //#region src/ui/input/input.d.ts
76
76
  declare const classes$1: (props?: ({
77
77
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "base" | "3xl" | null | undefined;
78
- gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
78
+ gap?: "sm" | "md" | "lg" | "none" | "xl" | "xs" | null | undefined;
79
79
  outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
80
- rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
80
+ rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | null | undefined;
81
81
  } & class_variance_authority_types1.ClassProp) | undefined) => string;
82
82
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
83
83
  size?: VariantProps<typeof classes$1>['size'];
@@ -92,7 +92,7 @@ declare const Input: react10.ForwardRefExoticComponent<InputProps & react10.RefA
92
92
  //#region src/ui/skeleton/skeleton.d.ts
93
93
  declare const classes: (props?: ({
94
94
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
95
- rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
95
+ rounded?: "sm" | "md" | "lg" | "none" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
96
96
  } & class_variance_authority_types1.ClassProp) | undefined) => string;
97
97
  interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
98
98
  width?: string | number;
@@ -107,7 +107,7 @@ declare function Skeleton({
107
107
  height,
108
108
  className,
109
109
  ...props
110
- }: SkeletonProps): react_jsx_runtime11.JSX.Element;
110
+ }: SkeletonProps): react_jsx_runtime12.JSX.Element;
111
111
  //#endregion
112
112
  //#region src/ui/stable-text/stable-text.d.ts
113
113
  declare function StableText({
@@ -116,6 +116,6 @@ declare function StableText({
116
116
  ...props
117
117
  }: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
118
118
  children: string | number;
119
- }): react_jsx_runtime11.JSX.Element;
119
+ }): react_jsx_runtime12.JSX.Element;
120
120
  //#endregion
121
121
  export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
package/dist/ui/index.mjs CHANGED
@@ -1 +1 @@
1
- import{y as e}from"../util-zXJA6Gnc.mjs";import{t}from"../skeleton-S6S1ZnCy.mjs";import n from"clsx";import r,{forwardRef as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";import{Slot as c}from"@radix-ui/react-slot";function l({className:e,items:t,render:i,...o}){return a(`nav`,{"data-komc":!0,"aria-label":`bottom app bar`,className:n(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...o,children:a(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>a(r.Fragment,{children:i(e)},t))})})}const u=s(e(`komc:flex komc:justify-center komc:items-center komc:gap-x-2 komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:[&_svg]:transition-colors komc:[&_svg]:duration-200`,`komc:cursor-pointer komc:disabled:cursor-default`),{variants:{size:{xxs:`komc:h-7.5`,xs:`komc:h-8`,sm:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`,"4xl":`komc:h-15`},shadow:{none:``,sm:`komc:drop-shadow-sm`,md:`komc:drop-shadow-md`,lg:`komc:drop-shadow-lg`,xl:`komc:drop-shadow-xl`,"2xl":`komc:drop-shadow-2xl`,"3xl":`komc:drop-shadow-3xl`},outline:{line:`komc:border`,solid:`komc:border komc:border-transparent`,clear:`komc:border-none`},variant:{blue:``,duo:``,white:``,gray:``,neutral:``,night:``,black:``,sky:``,"sky-blue":``,indigo:``},px:{none:`komc:px-0`,xs:`komc:px-0.5`,sm:`komc:px-1`,md:`komc:px-1.5`,lg:`komc:px-2`,xl:`komc:px-3`,"2xl":`komc:px-4`,"3xl":`komc:px-5`,"4xl":`komc:px-6`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},compoundVariants:[{outline:`line`,variant:`blue`,className:e(`komc:border-blue-500 komc:bg-white komc:text-blue-500`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`duo`,className:e(`komc:border-blue-500 komc:bg-white komc:text-brand-blck`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`white`,className:e(`komc:border-gray-600 komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200 komc:hover:text-brand-blck`,`komc:active:bg-gray-200 komc:active:text-brand-blck`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`gray`,className:e(`komc:border-white komc:bg-transparent komc:text-white`,`komc:hover:bg-[rgb(199,199,199)] komc:hover:text-white`,`komc:active:bg-[rgb(199,199,199)] komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`neutral`,className:e(`komc:border-gray-800 komc:bg-transparent komc:text-black`,`komc:hover:bg-gray-200 komc:hover:text-black`,`komc:active:bg-gray-200 komc:active:text-black`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky`,className:e(`komc:border-sky-750 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-750 komc:hover:text-white`,`komc:active:bg-sky-750 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky-blue`,className:e(`komc:border-sky-450 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-450 komc:hover:text-white`,`komc:active:bg-sky-450 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`solid`,variant:`white`,className:e(`komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200`,`komc:active:bg-gray-200`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`gray`,className:e(`komc:bg-gray-100 komc:text-blue-500`,`komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`blue`,className:e(`komc:bg-blue-500 komc:text-white`,`komc:hover:bg-night-700 komc:hover:text-white`,`komc:active:bg-night-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`night`,className:e(`komc:bg-night-700 komc:text-white`,`komc:hover:bg-night-800 komc:hover:text-white`,`komc:active:bg-night-800 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`black`,className:e(`komc:bg-[rgb(95,95,96)] komc:text-white`,`komc:hover:bg-[rgb(76,76,77)] komc:hover:text-white`,`komc:active:bg-[rgb(76,76,77)] komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`sky`,className:e(`komc:bg-sky-750 komc:text-white`,`komc:hover:bg-sky-950 komc:hover:text-white`,`komc:active:bg-sky-950 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`sky-blue`,className:e(`komc:bg-sky-450 komc:text-white`,`komc:hover:bg-sky-650 komc:hover:text-white`,`komc:active:bg-sky-650 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`indigo`,className:e(`komc:bg-indigo-600 komc:text-white`,`komc:hover:bg-indigo-700 komc:hover:text-white`,`komc:active:bg-indigo-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`clear`,variant:`sky`,className:e(`komc:bg-transparent komc:text-[#1890FF]`,`komc:hover:bg-transparent komc:hover:text-[#1890FF] komc:hover:underline`,`komc:active:bg-transparent komc:active:text-[#1890FF] komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`clear`,variant:`gray`,className:e(`komc:bg-transparent komc:text-gray-800`,`komc:hover:bg-transparent komc:hover:text-gray-800 komc:hover:underline`,`komc:active:bg-transparent komc:active:text-gray-800 komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)}],defaultVariants:{size:`md`,shadow:`none`,outline:`line`,variant:`blue`,px:`2xl`,rounded:`sm`}});var d=i(({type:e=`button`,className:t,id:n,size:r,shadow:i,outline:o,variant:s,px:l,rounded:d,asChild:f,...p},m)=>a(f?c:`button`,{ref:m,...p,type:e,id:n,className:u({size:r,shadow:i,outline:o,variant:s,px:l,rounded:d,className:t})}));function f({condition:e,wrapper:t,children:n}){return e?t(n):n}const p=s(e(`komc:flex komc:items-center komc:w-full komc:px-2`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:h-full`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}});var m=i(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:s=`lg`,className:c,...l},u)=>o(`div`,{"data-komc":!0,className:p({size:n,gap:r,outline:i,rounded:s,className:c}),children:[e,a(`input`,{ref:u,type:`text`,...l}),t]}));function h({children:e,className:t,...r}){return a(`span`,{...r,"data-komc":!0,"data-text":`${e}`,className:n(`komc:inline-flex komc:flex-col komc:justify-center komc:items-center`,`komc:after:content-[attr(data-text)] komc:after:font-bold`,`komc:after:h-0 komc:after:invisible komc:after:overflow-hidden`,`komc:after:select-none komc:after:pointer-events-none`,t),children:e})}export{l as BottomAppBar,d as Button,f as ConditionalWrapper,m as Input,t as Skeleton,h as StableText};
1
+ import{n as e}from"../common-DbEp6YNc.mjs";import{t}from"../skeleton-6QtpIO7l.mjs";import n from"clsx";import r,{forwardRef as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";import{Slot as c}from"@radix-ui/react-slot";function l({className:e,items:t,render:i,...o}){return a(`nav`,{"data-komc":!0,"aria-label":`bottom app bar`,className:n(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...o,children:a(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>a(r.Fragment,{children:i(e)},t))})})}const u=s(e(`komc:flex komc:justify-center komc:items-center komc:gap-x-2 komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:[&_svg]:transition-colors komc:[&_svg]:duration-200`,`komc:cursor-pointer komc:disabled:cursor-default`),{variants:{size:{xxs:`komc:h-7.5`,xs:`komc:h-8`,sm:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`,"4xl":`komc:h-15`},shadow:{none:``,sm:`komc:drop-shadow-sm`,md:`komc:drop-shadow-md`,lg:`komc:drop-shadow-lg`,xl:`komc:drop-shadow-xl`,"2xl":`komc:drop-shadow-2xl`,"3xl":`komc:drop-shadow-3xl`},outline:{line:`komc:border`,solid:`komc:border komc:border-transparent`,clear:`komc:border-none`},variant:{blue:``,duo:``,white:``,gray:``,neutral:``,night:``,black:``,sky:``,"sky-blue":``,indigo:``},px:{none:`komc:px-0`,xs:`komc:px-0.5`,sm:`komc:px-1`,md:`komc:px-1.5`,lg:`komc:px-2`,xl:`komc:px-3`,"2xl":`komc:px-4`,"3xl":`komc:px-5`,"4xl":`komc:px-6`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},compoundVariants:[{outline:`line`,variant:`blue`,className:e(`komc:border-blue-500 komc:bg-white komc:text-blue-500`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`duo`,className:e(`komc:border-blue-500 komc:bg-white komc:text-brand-blck`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`white`,className:e(`komc:border-gray-600 komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200 komc:hover:text-brand-blck`,`komc:active:bg-gray-200 komc:active:text-brand-blck`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`gray`,className:e(`komc:border-white komc:bg-transparent komc:text-white`,`komc:hover:bg-[rgb(199,199,199)] komc:hover:text-white`,`komc:active:bg-[rgb(199,199,199)] komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`neutral`,className:e(`komc:border-gray-800 komc:bg-transparent komc:text-black`,`komc:hover:bg-gray-200 komc:hover:text-black`,`komc:active:bg-gray-200 komc:active:text-black`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky`,className:e(`komc:border-sky-750 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-750 komc:hover:text-white`,`komc:active:bg-sky-750 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky-blue`,className:e(`komc:border-sky-450 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-450 komc:hover:text-white`,`komc:active:bg-sky-450 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`solid`,variant:`white`,className:e(`komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200`,`komc:active:bg-gray-200`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`gray`,className:e(`komc:bg-gray-100 komc:text-blue-500`,`komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`blue`,className:e(`komc:bg-blue-500 komc:text-white`,`komc:hover:bg-night-700 komc:hover:text-white`,`komc:active:bg-night-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`night`,className:e(`komc:bg-night-700 komc:text-white`,`komc:hover:bg-night-800 komc:hover:text-white`,`komc:active:bg-night-800 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`black`,className:e(`komc:bg-[rgb(95,95,96)] komc:text-white`,`komc:hover:bg-[rgb(76,76,77)] komc:hover:text-white`,`komc:active:bg-[rgb(76,76,77)] komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`sky`,className:e(`komc:bg-sky-750 komc:text-white`,`komc:hover:bg-sky-950 komc:hover:text-white`,`komc:active:bg-sky-950 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`sky-blue`,className:e(`komc:bg-sky-450 komc:text-white`,`komc:hover:bg-sky-650 komc:hover:text-white`,`komc:active:bg-sky-650 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`indigo`,className:e(`komc:bg-indigo-600 komc:text-white`,`komc:hover:bg-indigo-700 komc:hover:text-white`,`komc:active:bg-indigo-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`clear`,variant:`sky`,className:e(`komc:bg-transparent komc:text-[#1890FF]`,`komc:hover:bg-transparent komc:hover:text-[#1890FF] komc:hover:underline`,`komc:active:bg-transparent komc:active:text-[#1890FF] komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`clear`,variant:`gray`,className:e(`komc:bg-transparent komc:text-gray-800`,`komc:hover:bg-transparent komc:hover:text-gray-800 komc:hover:underline`,`komc:active:bg-transparent komc:active:text-gray-800 komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)}],defaultVariants:{size:`md`,shadow:`none`,outline:`line`,variant:`blue`,px:`2xl`,rounded:`sm`}});var d=i(({type:e=`button`,className:t,id:n,size:r,shadow:i,outline:o,variant:s,px:l,rounded:d,asChild:f,...p},m)=>a(f?c:`button`,{ref:m,...p,type:e,id:n,className:u({size:r,shadow:i,outline:o,variant:s,px:l,rounded:d,className:t})}));function f({condition:e,wrapper:t,children:n}){return e?t(n):n}const p=s(e(`komc:flex komc:items-center komc:w-full komc:px-2`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:h-full`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}});var m=i(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:s=`lg`,className:c,...l},u)=>o(`div`,{"data-komc":!0,className:p({size:n,gap:r,outline:i,rounded:s,className:c}),children:[e,a(`input`,{ref:u,type:`text`,...l}),t]}));function h({children:e,className:t,...r}){return a(`span`,{...r,"data-komc":!0,"data-text":`${e}`,className:n(`komc:inline-flex komc:flex-col komc:justify-center komc:items-center`,`komc:after:content-[attr(data-text)] komc:after:font-bold`,`komc:after:h-0 komc:after:invisible komc:after:overflow-hidden`,`komc:after:select-none komc:after:pointer-events-none`,t),children:e})}export{l as BottomAppBar,d as Button,f as ConditionalWrapper,m as Input,t as Skeleton,h as StableText};
@@ -0,0 +1 @@
1
+ "use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../hooks--O5RcEJq.cjs`);require(`../../providers-CkXkdYcB.cjs`),require(`../../use-subset-image-DhX5WmYG.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;
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/ui/sheet/sheet.d.ts
5
+ type Direction = 'top' | 'bottom' | 'left' | 'right';
6
+ type Size = 'full' | 'half' | 'auto';
7
+ interface SheetProps {
8
+ isOpen: boolean;
9
+ onClose: () => void;
10
+ direction?: Direction;
11
+ size?: Size;
12
+ children: React.ReactNode;
13
+ className?: string;
14
+ closeOnBackdropClick?: boolean;
15
+ zIndex?: number;
16
+ }
17
+ declare function Sheet({
18
+ isOpen,
19
+ onClose,
20
+ direction,
21
+ size,
22
+ children,
23
+ className,
24
+ closeOnBackdropClick,
25
+ zIndex
26
+ }: SheetProps): react_jsx_runtime0.JSX.Element | null;
27
+ //#endregion
28
+ export { Sheet, type SheetProps };
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/ui/sheet/sheet.d.ts
5
+ type Direction = 'top' | 'bottom' | 'left' | 'right';
6
+ type Size = 'full' | 'half' | 'auto';
7
+ interface SheetProps {
8
+ isOpen: boolean;
9
+ onClose: () => void;
10
+ direction?: Direction;
11
+ size?: Size;
12
+ children: React.ReactNode;
13
+ className?: string;
14
+ closeOnBackdropClick?: boolean;
15
+ zIndex?: number;
16
+ }
17
+ declare function Sheet({
18
+ isOpen,
19
+ onClose,
20
+ direction,
21
+ size,
22
+ children,
23
+ className,
24
+ closeOnBackdropClick,
25
+ zIndex
26
+ }: SheetProps): react_jsx_runtime0.JSX.Element | null;
27
+ //#endregion
28
+ export { Sheet, type SheetProps };
@@ -0,0 +1 @@
1
+ "use client";import"../../src-CukOR3K2.mjs";import"../../file-DShNxIW4.mjs";import{o as e}from"../../hooks-C9rXWkfW.mjs";import"../../providers-zftmvT1z.mjs";import"../../use-subset-image-DvV5Mlkc.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};
@@ -0,0 +1 @@
1
+ "use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-CjpmdVyv.cjs`);const t=require(`../../common-CQWUs1nE.cjs`);require(`../../file-5mweNdAM.cjs`);const n=require(`../../hooks--O5RcEJq.cjs`);require(`../../providers-CkXkdYcB.cjs`),require(`../../use-subset-image-DhX5WmYG.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,style:r,...o})=>{let s=(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) ${s}`},...o})};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`},u)=>{let[f,p]=(0,i.useState)(o),m=(0,i.useRef)(null),h=(0,i.useRef)(null);return n.i({ref:m,setOpen:p}),(0,a.jsxs)(`div`,{ref:m,"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:p,children:e}),(0,a.jsx)(y,{placement:l,className:s,open:f,content:t,hiddenRef:h,containerRef:m}),(0,a.jsx)(d,{ref:h,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;
@@ -0,0 +1,16 @@
1
+ import * as react0 from "react";
2
+ import { HTMLAttributes } from "react";
3
+
4
+ //#region src/ui/tooltip/tooltip-container.d.ts
5
+ type SubPlacement = 'start' | 'end';
6
+ type MainPlacement = 'top' | 'bottom';
7
+ type TooltipPlacement = MainPlacement | `${MainPlacement}-${SubPlacement}`;
8
+ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
9
+ children: React.ReactNode;
10
+ content: string;
11
+ placement?: TooltipPlacement;
12
+ defaultOpen?: boolean;
13
+ }
14
+ declare const TooltipContainer: react0.ForwardRefExoticComponent<TooltipContainerProps & react0.RefAttributes<HTMLDivElement>>;
15
+ //#endregion
16
+ export { TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };