@machinerd/js-module 0.5.1 → 0.5.3

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.
@@ -1,5 +1,5 @@
1
1
  import { n as ApiConfig, t as ApiClient } from "../index-CH1uVFqx.cjs";
2
- import * as react_jsx_runtime9 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/providers/api-client/api-client.d.ts
5
5
  declare function ApiClientProvider({
@@ -8,7 +8,7 @@ declare function ApiClientProvider({
8
8
  }: {
9
9
  children: React.ReactNode;
10
10
  config: ApiConfig;
11
- }): react_jsx_runtime9.JSX.Element;
11
+ }): react_jsx_runtime0.JSX.Element;
12
12
  declare function useApiClient(): ApiClient;
13
13
  //#endregion
14
14
  export { ApiClientProvider, useApiClient };
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.2.3 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
4
  @layer theme {
@@ -139,6 +139,9 @@
139
139
  .komc\:-mt-4 {
140
140
  margin-top: calc(var(--komc-spacing) * -4);
141
141
  }
142
+ .komc\:mt-2 {
143
+ margin-top: calc(var(--komc-spacing) * 2);
144
+ }
142
145
  .komc\:mt-3 {
143
146
  margin-top: calc(var(--komc-spacing) * 3);
144
147
  }
@@ -271,6 +274,9 @@
271
274
  .komc\:w-2 {
272
275
  width: calc(var(--komc-spacing) * 2);
273
276
  }
277
+ .komc\:w-4 {
278
+ width: calc(var(--komc-spacing) * 4);
279
+ }
274
280
  .komc\:w-\[50dvw\] {
275
281
  width: 50dvw;
276
282
  }
@@ -334,6 +340,9 @@
334
340
  .komc\:grow-0 {
335
341
  flex-grow: 0;
336
342
  }
343
+ .komc\:basis-1\/2\! {
344
+ flex-basis: calc(1 / 2 * 100%) !important;
345
+ }
337
346
  .komc\:basis-full {
338
347
  flex-basis: 100%;
339
348
  }
@@ -407,6 +416,9 @@
407
416
  .komc\:gap-1 {
408
417
  gap: calc(var(--komc-spacing) * 1);
409
418
  }
419
+ .komc\:gap-1\.5 {
420
+ gap: calc(var(--komc-spacing) * 1.5);
421
+ }
410
422
  .komc\:gap-2 {
411
423
  gap: calc(var(--komc-spacing) * 2);
412
424
  }
@@ -574,6 +586,9 @@
574
586
  background-color: color-mix(in oklab, var(--komc-color-neutral-100) 95%, transparent);
575
587
  }
576
588
  }
589
+ .komc\:bg-neutral-300 {
590
+ background-color: var(--komc-color-neutral-300);
591
+ }
577
592
  .komc\:bg-night-700 {
578
593
  background-color: var(--komc-color-night-700);
579
594
  }
@@ -1141,6 +1156,16 @@
1141
1156
  color: var(--komc-color-gray-800);
1142
1157
  }
1143
1158
  }
1159
+ .komc\:data-\[selected\=true\]\:bg-blue-500 {
1160
+ &[data-selected="true"] {
1161
+ background-color: var(--komc-color-blue-500);
1162
+ }
1163
+ }
1164
+ .komc\:data-\[selected\=true\]\:text-white {
1165
+ &[data-selected="true"] {
1166
+ color: var(--komc-color-white);
1167
+ }
1168
+ }
1144
1169
  .komc\:data-\[state\=closed\]\:scale-95 {
1145
1170
  &[data-state="closed"] {
1146
1171
  --tw-scale-x: 95%;
@@ -1,7 +1,7 @@
1
1
  import * as react10 from "react";
2
2
  import React$1, { ComponentProps, HTMLAttributes } from "react";
3
- import * as react_jsx_runtime8 from "react/jsx-runtime";
4
- import * as class_variance_authority_types1 from "class-variance-authority/types";
3
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
4
+ import * as class_variance_authority_types2 from "class-variance-authority/types";
5
5
  import { VariantProps } from "class-variance-authority";
6
6
 
7
7
  //#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
@@ -18,13 +18,13 @@ declare function BottomAppBar<T>({
18
18
  //#endregion
19
19
  //#region src/ui/button/button.d.ts
20
20
  declare const classes$2: (props?: ({
21
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xxs" | "xs" | "3xl" | "4xl" | null | undefined;
21
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "xxs" | "4xl" | null | undefined;
22
22
  shadow?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
23
23
  outline?: "line" | "solid" | "clear" | null | undefined;
24
24
  variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
25
25
  px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
26
26
  rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
27
- } & class_variance_authority_types1.ClassProp) | undefined) => string;
27
+ } & class_variance_authority_types2.ClassProp) | undefined) => string;
28
28
  interface VariantMap {
29
29
  line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
30
30
  solid: 'white' | 'gray' | 'blue' | 'night' | 'black' | 'sky' | 'sky-blue' | 'indigo';
@@ -74,11 +74,11 @@ declare function ConditionalWrapper({
74
74
  //#endregion
75
75
  //#region src/ui/input/input.d.ts
76
76
  declare const classes$1: (props?: ({
77
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "base" | "xs" | "3xl" | null | undefined;
77
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "base" | "3xl" | null | undefined;
78
78
  gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
79
79
  outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
80
80
  rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
81
- } & class_variance_authority_types1.ClassProp) | undefined) => string;
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'];
84
84
  gap?: VariantProps<typeof classes$1>['gap'];
@@ -93,7 +93,7 @@ declare const Input: react10.ForwardRefExoticComponent<InputProps & react10.RefA
93
93
  declare const classes: (props?: ({
94
94
  size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
95
95
  rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
96
- } & class_variance_authority_types1.ClassProp) | undefined) => string;
96
+ } & class_variance_authority_types2.ClassProp) | undefined) => string;
97
97
  interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
98
98
  width?: string | number;
99
99
  height?: string | number;
@@ -107,7 +107,7 @@ declare function Skeleton({
107
107
  height,
108
108
  className,
109
109
  ...props
110
- }: SkeletonProps): react_jsx_runtime8.JSX.Element;
110
+ }: SkeletonProps): react_jsx_runtime4.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_runtime8.JSX.Element;
119
+ }): react_jsx_runtime4.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,8 +1,8 @@
1
- import * as react7 from "react";
1
+ import * as react10 from "react";
2
2
  import React$1, { ComponentProps, HTMLAttributes } from "react";
3
- import * as react_jsx_runtime9 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
- import * as class_variance_authority_types0 from "class-variance-authority/types";
5
+ import * as class_variance_authority_types1 from "class-variance-authority/types";
6
6
 
7
7
  //#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
8
8
  interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
@@ -18,13 +18,13 @@ declare function BottomAppBar<T>({
18
18
  //#endregion
19
19
  //#region src/ui/button/button.d.ts
20
20
  declare const classes$2: (props?: ({
21
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xxs" | "xs" | "3xl" | "4xl" | null | undefined;
21
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "xxs" | "4xl" | null | undefined;
22
22
  shadow?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
23
23
  outline?: "line" | "solid" | "clear" | null | undefined;
24
24
  variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
25
25
  px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
26
26
  rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
27
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
27
+ } & class_variance_authority_types1.ClassProp) | undefined) => string;
28
28
  interface VariantMap {
29
29
  line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
30
30
  solid: 'white' | 'gray' | 'blue' | 'night' | 'black' | 'sky' | 'sky-blue' | 'indigo';
@@ -43,22 +43,22 @@ type ButtonProps = ComponentProps<'button'> & BaseProps & ({
43
43
  }) & {
44
44
  asChild?: boolean;
45
45
  };
46
- declare const Button: react7.ForwardRefExoticComponent<(Omit<react7.ClassAttributes<HTMLButtonElement> & react7.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
46
+ declare const Button: react10.ForwardRefExoticComponent<(Omit<react10.ClassAttributes<HTMLButtonElement> & react10.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
47
47
  outline?: "line";
48
48
  variant?: VariantMap["line"];
49
49
  } & {
50
50
  asChild?: boolean;
51
- }, "ref"> | Omit<react7.ClassAttributes<HTMLButtonElement> & react7.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
51
+ }, "ref"> | Omit<react10.ClassAttributes<HTMLButtonElement> & react10.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
52
52
  outline: "solid";
53
53
  variant?: VariantMap["solid"];
54
54
  } & {
55
55
  asChild?: boolean;
56
- }, "ref"> | Omit<react7.ClassAttributes<HTMLButtonElement> & react7.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
56
+ }, "ref"> | Omit<react10.ClassAttributes<HTMLButtonElement> & react10.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
57
57
  outline: "clear";
58
58
  variant?: VariantMap["clear"];
59
59
  } & {
60
60
  asChild?: boolean;
61
- }, "ref">) & react7.RefAttributes<HTMLButtonElement>>;
61
+ }, "ref">) & react10.RefAttributes<HTMLButtonElement>>;
62
62
  //#endregion
63
63
  //#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
64
64
  interface ConditionalWrapperProps {
@@ -70,15 +70,15 @@ declare function ConditionalWrapper({
70
70
  condition,
71
71
  wrapper,
72
72
  children
73
- }: ConditionalWrapperProps): react7.ReactNode;
73
+ }: ConditionalWrapperProps): react10.ReactNode;
74
74
  //#endregion
75
75
  //#region src/ui/input/input.d.ts
76
76
  declare const classes$1: (props?: ({
77
- size?: "sm" | "md" | "lg" | "xl" | "2xl" | "base" | "xs" | "3xl" | null | undefined;
77
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "base" | "3xl" | null | undefined;
78
78
  gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
79
79
  outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
80
80
  rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
81
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
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'];
84
84
  gap?: VariantProps<typeof classes$1>['gap'];
@@ -87,13 +87,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
87
87
  prefix?: React.ReactNode;
88
88
  surffix?: React.ReactNode;
89
89
  }
90
- declare const Input: react7.ForwardRefExoticComponent<InputProps & react7.RefAttributes<HTMLInputElement>>;
90
+ declare const Input: react10.ForwardRefExoticComponent<InputProps & react10.RefAttributes<HTMLInputElement>>;
91
91
  //#endregion
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
95
  rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
96
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
96
+ } & class_variance_authority_types1.ClassProp) | undefined) => string;
97
97
  interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
98
98
  width?: string | number;
99
99
  height?: string | number;
@@ -107,7 +107,7 @@ declare function Skeleton({
107
107
  height,
108
108
  className,
109
109
  ...props
110
- }: SkeletonProps): react_jsx_runtime9.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_runtime9.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 +1 @@
1
- const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../src-CjpmdVyv.cjs`);const t=require(`../util-o7fjt7iK.cjs`),n=require(`../skeleton-g6yXh6D9.cjs`),r=require(`../hooks-DqgWx1Fa.cjs`);require(`../providers-BNK8Fisc.cjs`);let i=require(`clsx`);i=e.t(i);let a=require(`react`);a=e.t(a);let o=require(`react/jsx-runtime`),s=require(`class-variance-authority`),c=require(`embla-carousel-react`);c=e.t(c);let l=require(`react-dom`);const u=a.default.createContext(null);function d(){let e=a.default.useContext(u);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function f({orientation:e=`horizontal`,options:n,setApi:r,plugins:i,className:s,children:l,...d}){let[f,p]=(0,c.default)({...n,axis:e===`horizontal`?`x`:`y`},i),[m,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(!1),v=(0,a.useCallback)(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()))},[]),y=(0,a.useCallback)(()=>{p?.scrollPrev()},[p]),b=(0,a.useCallback)(()=>{p?.scrollNext()},[p]),x=(0,a.useCallback)(t=>{e===`horizontal`?t.key===`ArrowLeft`?(t.preventDefault(),y()):t.key===`ArrowRight`&&(t.preventDefault(),b()):t.key===`ArrowUp`?(t.preventDefault(),y()):t.key===`ArrowDown`&&(t.preventDefault(),b())},[y,b,e]);return(0,a.useEffect)(()=>{!p||!r||r(p)},[p,r]),(0,a.useEffect)(()=>{if(p)return v(p),p.on(`reInit`,v),p.on(`select`,v),()=>{p?.off(`select`,v)}},[p,v]),(0,o.jsx)(u.Provider,{value:{carouselRef:f,api:p,options:n,orientation:e||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:y,scrollNext:b,canScrollPrev:m,canScrollNext:g},children:(0,o.jsx)(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:x,className:t.y(`komc:relative`,s),...d,children:l})})}function p({className:e,...n}){let{carouselRef:r,orientation:i}=d();return(0,o.jsx)(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:(0,o.jsx)(`div`,{className:t.y(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,e),...n})})}function m({className:e,...n}){let{orientation:r}=d();return(0,o.jsx)(`div`,{"data-komc":!0,className:t.y(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,e),...n})}function h({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:a}=d();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!a,"aria-label":`previous slide`,className:(0,i.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function g({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:a}=d();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!a,"aria-label":`next slide`,className:(0,i.default)(`komc:w-full`,t),onClick:r,...n,children:e})}const _=(0,s.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 v({closeOnBackdropClick:e=!0,isOpen:t,zIndex:n=1e4,padding:i,maxWidth:s,className:c,onClose:l,children:u,...d}){let f=r.c(t,300),[p,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(t&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else t||m(!1)},[t,f]);let h=(0,a.useCallback)(e=>{e.key===`Escape`&&l()},[l]),g=(0,a.useCallback)(()=>{e&&l()},[e,l]);return(0,a.useEffect)(()=>(t?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[t,h]),f?(0,o.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:n},children:(0,o.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,o.jsx)(`button`,{type:`button`,"data-state":p?`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:g,"aria-label":`close dialog`}),(0,o.jsx)(`div`,{"data-state":p?`open`:`closed`,className:`${_({padding:i,maxWidth:s,className:c})} 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`,...d,children:u})]})}):null}const y=(0,s.cva)(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),b=(0,a.forwardRef)(({...e},t)=>{let{ref:n,imageProps:i}=r.r({ref:t,...e});return(0,o.jsx)(`img`,{ref:n,...i})}),x=(0,a.forwardRef)(({skeleton:e=!0,layout:t=`stretch`,fallbackSrc:a,className:s,emptyNode:c,emptyNodeClassName:l,skeletonClassName:u,...d},f)=>{let{ref:p,isLoad:m,isError:h,imageProps:g}=r.r({ref:f,fallbackSrc:a,forceLoad:!e,...d}),_=!d.fill&&t===`intrinsic`?{width:`${d.width}px`,height:`${d.height}px`}:void 0,v=(0,i.default)(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!d.fill&&t===`stretch`&&`komc:w-full komc:h-full`);return!a&&h&&c?d.fill?(0,o.jsx)(S,{className:l,children:c}):(0,o.jsx)(`div`,{"data-komc":!0,style:_,className:v,children:(0,o.jsx)(S,{className:l,children:c})}):d.fill?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`img`,{ref:p,...g,className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:invisible`:`komc:visible`,s)}),(0,o.jsx)(`div`,{"data-komc":!0,className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,o.jsx)(n.t,{size:`full`,className:u})})]}):(0,o.jsxs)(`div`,{"data-komc":!0,style:_,className:v,children:[(0,o.jsx)(`img`,{ref:p,...g,className:(0,i.default)(y({fill:d.fill,className:s}),e&&!m?`komc:invisible`:`komc:visible`)}),(0,o.jsx)(`div`,{className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,o.jsx)(n.t,{size:`full`,className:u})})]})}),S=({children:e,className:t})=>(0,o.jsx)(`div`,{"data-komc":!0,role:`alert`,className:(0,i.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 C=x;const w=(0,s.cva)((0,i.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`}}}),T=(0,s.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 E({isOpen:e,onClose:t,direction:n=`bottom`,size:s=`full`,children:c,className:l,closeOnBackdropClick:u=!0,zIndex:d=1001}){let f=r.c(e,300),[p,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(e&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else e||m(!1)},[e,f]);let h=(0,a.useCallback)(e=>{e.key===`Escape`&&t()},[t]),g=(0,a.useCallback)(()=>{u&&t()},[u,t]);return(0,a.useEffect)(()=>(e?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[e,h]),f?(0,o.jsxs)(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[(0,o.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:(0,i.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:g,"aria-label":`close sheet`}),(0,o.jsx)(`div`,{"data-state":p?`open`:`closed`,className:(0,i.default)(w({direction:n,className:l}),T({direction:n,size:s})),role:`dialog`,"aria-modal":`true`,children:c})]}):null}function D({children:e,setOpen:t}){return(0,o.jsx)(`div`,{"data-komc":!0,className:(0,i.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 O=(0,s.cva)(t.y(`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}}),k=(0,a.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},a)=>(0,o.jsx)(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:O({portal:e,placement:r,className:n}),...i,children:t}));var A=k;const j=(0,s.cva)(t.y(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.y(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.y(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":t.y(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.y(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.y(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.y(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}}),M=({placement:e,className:t,offset:n,style:r,...i})=>{let s=(0,a.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,o.jsx)(`div`,{className:j({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${s}`},...i})};var N=M;const P=24,F=2,I=180,L=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function R({placement:e,className:t,content:n,open:r,hiddenRef:s,containerRef:c}){let[u,d]=(0,a.useState)(!1),[f,p]=(0,a.useState)(e),[m,h]=(0,a.useState)({top:0,left:0}),[g,_]=(0,a.useState)({x:0,y:0});(0,a.useEffect)(()=>{d(!0)},[]);let v=(0,a.useCallback)(()=>{let t=c.current,n=s.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),l=r.top,u=window.innerHeight-r.bottom;o===`bottom`&&u<i.height&&l>=i.height?a=L(a,`top`):o===`top`&&l<i.height&&u>=i.height&&(a=L(a,`bottom`)),p(a);let[d,f]=a.split(`-`),m=r.top,g=r.left+r.width/2-i.width/2;switch(d){case`top`:m-=i.height;break;case`bottom`:m+=r.height;break}switch(f){case`start`:g+=i.width/2-24;break;case`end`:g-=i.width/2-24;break}let v=g,y=window.innerWidth;v+i.width>y-4&&(v=y-i.width-4),v<4&&(v=4),h({top:m,left:v}),_({x:g-v,y:0})},[e,c,s]);return(0,a.useEffect)(()=>{if(!u||!r)return;console.log(`updateLayout`);let e=!1,t=0,n=0,i=!1;v();let a=()=>{i||=(t=requestAnimationFrame(()=>{e||v(),i=!1}),!0)};window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let o=0,s=0,l=``,d=()=>{if(e||o>=180)return;let t=c.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===l?s+=1:(s=0,l=n,v())}s<2&&(o+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[u,r,v,c]),u?(0,l.createPortal)((0,o.jsxs)(A,{portal:!0,"data-komc":!0,placement:f,className:(0,i.default)(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...m},children:[(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(N,{placement:f,offset:g})]}),document.body):null}const z=(0,a.forwardRef)(({children:e,content:t,defaultOpen:n=!1,className:s,placement:c=`top`},l)=>{let[u,d]=(0,a.useState)(n),f=(0,a.useRef)(null),p=(0,a.useRef)(null);return r.o({ref:f,setOpen:d}),(0,o.jsxs)(`div`,{ref:f,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,o.jsx)(D,{setOpen:d,children:e}),(0,o.jsx)(R,{placement:c,className:s,open:u,content:t,hiddenRef:p,containerRef:f}),(0,o.jsx)(A,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:c,className:(0,i.default)(`komc:opacity-0 komc:invisible`,s),children:(0,o.jsx)(`span`,{children:t})})]})});var B=z;exports.BaseImage=b,exports.Carousel=f,exports.CarouselItem=m,exports.CarouselNext=g,exports.CarouselPrevious=h,exports.CarouselWrapper=p,exports.Dialog=v,exports.EmptyNode=S,exports.Image=C,exports.Sheet=E,exports.Tooltip=B;
1
+ const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../src-CjpmdVyv.cjs`);const t=require(`../util-o7fjt7iK.cjs`),n=require(`../skeleton-g6yXh6D9.cjs`),r=require(`../hooks-DqgWx1Fa.cjs`);require(`../providers-BNK8Fisc.cjs`);let i=require(`clsx`);i=e.t(i);let a=require(`react`);a=e.t(a);let o=require(`react/jsx-runtime`),s=require(`class-variance-authority`),c=require(`embla-carousel-react`);c=e.t(c);let l=require(`react-dom`);const u=a.default.createContext(null);function d(){let e=a.default.useContext(u);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function f({orientation:e=`horizontal`,options:n,setApi:r,plugins:i,className:s,children:l,...d}){let[f,p]=(0,c.default)({...n,axis:e===`horizontal`?`x`:`y`},i),[m,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(!1),[v,y]=(0,a.useState)(0),[b,x]=(0,a.useState)(0),S=(0,a.useCallback)(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()),x(e.selectedScrollSnap()))},[]),C=(0,a.useCallback)(()=>{p?.scrollPrev()},[p]),w=(0,a.useCallback)(()=>{p?.scrollNext()},[p]),T=(0,a.useCallback)(e=>{p?.scrollTo(e)},[p]),E=(0,a.useCallback)(()=>{y(p?.scrollSnapList().length||0)},[p]),D=(0,a.useCallback)(t=>{e===`horizontal`?t.key===`ArrowLeft`?(t.preventDefault(),C()):t.key===`ArrowRight`&&(t.preventDefault(),w()):t.key===`ArrowUp`?(t.preventDefault(),C()):t.key===`ArrowDown`&&(t.preventDefault(),w())},[C,w,e]);return(0,a.useEffect)(()=>{!p||!r||r(p)},[p,r]),(0,a.useEffect)(()=>{if(p)return S(p),E(),p.on(`reInit`,E),p.on(`reInit`,S),p.on(`select`,S),()=>{p?.off(`select`,S)}},[p,S]),(0,o.jsx)(u.Provider,{value:{carouselRef:f,api:p,options:n,orientation:e||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:C,scrollNext:w,canScrollPrev:m,canScrollNext:g,scrollTo:T,dots:v,selectedScrollSnap:b},children:(0,o.jsx)(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:D,className:t.y(`komc:relative`,s),...d,children:l})})}function p({className:e,...n}){let{carouselRef:r,orientation:i}=d();return(0,o.jsx)(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:(0,o.jsx)(`div`,{className:t.y(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,e),...n})})}function m({className:e,...n}){let{orientation:r}=d();return(0,o.jsx)(`div`,{"data-komc":!0,className:t.y(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,e),...n})}function h({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:a}=d();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!a,"aria-label":`previous slide`,className:(0,i.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function g({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:a}=d();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!a,"aria-label":`next slide`,className:(0,i.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function _({children:e,...t}){let{dots:n,selectedScrollSnap:r,scrollTo:i}=d();return(0,o.jsx)(o.Fragment,{children:Array.from({length:n}).map((n,a)=>(0,o.jsx)(`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}=d();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,"data-selected":r===e,"aria-label":`go to slide ${e+1}`,onClick:()=>i(e),...n,children:t})}const y=(0,s.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 b({closeOnBackdropClick:e=!0,isOpen:t,zIndex:n=1e4,padding:i,maxWidth:s,className:c,onClose:l,children:u,...d}){let f=r.c(t,300),[p,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(t&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else t||m(!1)},[t,f]);let h=(0,a.useCallback)(e=>{e.key===`Escape`&&l()},[l]),g=(0,a.useCallback)(()=>{e&&l()},[e,l]);return(0,a.useEffect)(()=>(t?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[t,h]),f?(0,o.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:n},children:(0,o.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,o.jsx)(`button`,{type:`button`,"data-state":p?`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:g,"aria-label":`close dialog`}),(0,o.jsx)(`div`,{"data-state":p?`open`:`closed`,className:`${y({padding:i,maxWidth:s,className:c})} 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`,...d,children:u})]})}):null}const x=(0,s.cva)(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),S=(0,a.forwardRef)(({...e},t)=>{let{ref:n,imageProps:i}=r.r({ref:t,...e});return(0,o.jsx)(`img`,{ref:n,...i})}),C=(0,a.forwardRef)(({skeleton:e=!0,layout:t=`stretch`,fallbackSrc:a,className:s,emptyNode:c,emptyNodeClassName:l,skeletonClassName:u,...d},f)=>{let{ref:p,isLoad:m,isError:h,imageProps:g}=r.r({ref:f,fallbackSrc:a,forceLoad:!e,...d}),_=!d.fill&&t===`intrinsic`?{width:`${d.width}px`,height:`${d.height}px`}:void 0,v=(0,i.default)(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!d.fill&&t===`stretch`&&`komc:w-full komc:h-full`);return!a&&h&&c?d.fill?(0,o.jsx)(w,{className:l,children:c}):(0,o.jsx)(`div`,{"data-komc":!0,style:_,className:v,children:(0,o.jsx)(w,{className:l,children:c})}):d.fill?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`img`,{ref:p,...g,className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:invisible`:`komc:visible`,s)}),(0,o.jsx)(`div`,{"data-komc":!0,className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,o.jsx)(n.t,{size:`full`,className:u})})]}):(0,o.jsxs)(`div`,{"data-komc":!0,style:_,className:v,children:[(0,o.jsx)(`img`,{ref:p,...g,className:(0,i.default)(x({fill:d.fill,className:s}),e&&!m?`komc:invisible`:`komc:visible`)}),(0,o.jsx)(`div`,{className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,o.jsx)(n.t,{size:`full`,className:u})})]})}),w=({children:e,className:t})=>(0,o.jsx)(`div`,{"data-komc":!0,role:`alert`,className:(0,i.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 T=C;const E=(0,s.cva)((0,i.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`}}}),D=(0,s.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 O({isOpen:e,onClose:t,direction:n=`bottom`,size:s=`full`,children:c,className:l,closeOnBackdropClick:u=!0,zIndex:d=1001}){let f=r.c(e,300),[p,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(e&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else e||m(!1)},[e,f]);let h=(0,a.useCallback)(e=>{e.key===`Escape`&&t()},[t]),g=(0,a.useCallback)(()=>{u&&t()},[u,t]);return(0,a.useEffect)(()=>(e?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[e,h]),f?(0,o.jsxs)(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[(0,o.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:(0,i.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:g,"aria-label":`close sheet`}),(0,o.jsx)(`div`,{"data-state":p?`open`:`closed`,className:(0,i.default)(E({direction:n,className:l}),D({direction:n,size:s})),role:`dialog`,"aria-modal":`true`,children:c})]}):null}function k({children:e,setOpen:t}){return(0,o.jsx)(`div`,{"data-komc":!0,className:(0,i.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 A=(0,s.cva)(t.y(`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}}),j=(0,a.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},a)=>(0,o.jsx)(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:A({portal:e,placement:r,className:n}),...i,children:t}));var M=j;const N=(0,s.cva)(t.y(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.y(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.y(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":t.y(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.y(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.y(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.y(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}}),P=({placement:e,className:t,offset:n,style:r,...i})=>{let s=(0,a.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,o.jsx)(`div`,{className:N({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${s}`},...i})};var F=P;const I=24,L=2,R=180,z=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function B({placement:e,className:t,content:n,open:r,hiddenRef:s,containerRef:c}){let[u,d]=(0,a.useState)(!1),[f,p]=(0,a.useState)(e),[m,h]=(0,a.useState)({top:0,left:0}),[g,_]=(0,a.useState)({x:0,y:0});(0,a.useEffect)(()=>{d(!0)},[]);let v=(0,a.useCallback)(()=>{let t=c.current,n=s.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),l=r.top,u=window.innerHeight-r.bottom;o===`bottom`&&u<i.height&&l>=i.height?a=z(a,`top`):o===`top`&&l<i.height&&u>=i.height&&(a=z(a,`bottom`)),p(a);let[d,f]=a.split(`-`),m=r.top,g=r.left+r.width/2-i.width/2;switch(d){case`top`:m-=i.height;break;case`bottom`:m+=r.height;break}switch(f){case`start`:g+=i.width/2-24;break;case`end`:g-=i.width/2-24;break}let v=g,y=window.innerWidth;v+i.width>y-4&&(v=y-i.width-4),v<4&&(v=4),h({top:m,left:v}),_({x:g-v,y:0})},[e,c,s]);return(0,a.useEffect)(()=>{if(!u||!r)return;console.log(`updateLayout`);let e=!1,t=0,n=0,i=!1;v();let a=()=>{i||=(t=requestAnimationFrame(()=>{e||v(),i=!1}),!0)};window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let o=0,s=0,l=``,d=()=>{if(e||o>=180)return;let t=c.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===l?s+=1:(s=0,l=n,v())}s<2&&(o+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[u,r,v,c]),u?(0,l.createPortal)((0,o.jsxs)(M,{portal:!0,"data-komc":!0,placement:f,className:(0,i.default)(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...m},children:[(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(F,{placement:f,offset:g})]}),document.body):null}const V=(0,a.forwardRef)(({children:e,content:t,defaultOpen:n=!1,className:s,placement:c=`top`},l)=>{let[u,d]=(0,a.useState)(n),f=(0,a.useRef)(null),p=(0,a.useRef)(null);return r.o({ref:f,setOpen:d}),(0,o.jsxs)(`div`,{ref:f,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,o.jsx)(k,{setOpen:d,children:e}),(0,o.jsx)(B,{placement:c,className:s,open:u,content:t,hiddenRef:p,containerRef:f}),(0,o.jsx)(M,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:c,className:(0,i.default)(`komc:opacity-0 komc:invisible`,s),children:(0,o.jsx)(`span`,{children:t})})]})});var H=V;exports.BaseImage=S,exports.Carousel=f,exports.CarouselDot=v,exports.CarouselDots=_,exports.CarouselItem=m,exports.CarouselNext=g,exports.CarouselPrevious=h,exports.CarouselWrapper=p,exports.Dialog=b,exports.EmptyNode=w,exports.Image=T,exports.Sheet=O,exports.Tooltip=H;
@@ -1,7 +1,7 @@
1
1
  import { a as UseSubsetImageProps, n as BaseProps } from "../index-ComhjQ-q.cjs";
2
- import * as react3 from "react";
2
+ import * as react1 from "react";
3
3
  import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
4
- import * as react_jsx_runtime2 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
5
5
  import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
6
6
  import * as class_variance_authority_types0 from "class-variance-authority/types";
7
7
  import { VariantProps } from "class-variance-authority";
@@ -24,6 +24,9 @@ type CarouselContextProps = {
24
24
  scrollNext: () => void;
25
25
  canScrollPrev: boolean;
26
26
  canScrollNext: boolean;
27
+ scrollTo: (index: number) => void;
28
+ dots: number;
29
+ selectedScrollSnap: number;
27
30
  } & CarouselProps;
28
31
  //#endregion
29
32
  //#region src/ui-client/carousel/carousel.d.ts
@@ -41,33 +44,50 @@ declare function Carousel({
41
44
  className,
42
45
  children,
43
46
  ...props
44
- }: CarouselProps$1): react_jsx_runtime2.JSX.Element;
47
+ }: CarouselProps$1): react_jsx_runtime10.JSX.Element;
45
48
  //#endregion
46
49
  //#region src/ui-client/carousel/carousel-wrapper.d.ts
47
50
  declare function CarouselWrapper({
48
51
  className,
49
52
  ...props
50
- }: React$1.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
53
+ }: React$1.ComponentProps<'div'>): react_jsx_runtime10.JSX.Element;
51
54
  //#endregion
52
55
  //#region src/ui-client/carousel/carousel-item.d.ts
53
56
  declare function CarouselItem({
54
57
  className,
55
58
  ...props
56
- }: React$1.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
59
+ }: React$1.ComponentProps<'div'>): react_jsx_runtime10.JSX.Element;
57
60
  //#endregion
58
61
  //#region src/ui-client/carousel/carousel-previous.d.ts
59
62
  declare function CarouselPrevious({
60
63
  children,
61
64
  className,
62
65
  ...props
63
- }: React$1.ComponentProps<'button'>): react_jsx_runtime2.JSX.Element;
66
+ }: React$1.ComponentProps<'button'>): react_jsx_runtime10.JSX.Element;
64
67
  //#endregion
65
68
  //#region src/ui-client/carousel/carousel-next.d.ts
66
69
  declare function CarouselNext({
67
70
  children,
68
71
  className,
69
72
  ...props
70
- }: React$1.ComponentProps<'button'>): react_jsx_runtime2.JSX.Element;
73
+ }: React$1.ComponentProps<'button'>): react_jsx_runtime10.JSX.Element;
74
+ //#endregion
75
+ //#region src/ui-client/carousel/carousel-dots.d.ts
76
+ declare function CarouselDots$1({
77
+ children,
78
+ ...props
79
+ }: Omit<React$1.ComponentProps<'button'>, 'children'> & {
80
+ children?: (index: number) => React$1.ReactNode;
81
+ }): react_jsx_runtime10.JSX.Element;
82
+ //#endregion
83
+ //#region src/ui-client/carousel/carousel-dot.d.ts
84
+ declare function CarouselDots({
85
+ index,
86
+ children,
87
+ ...props
88
+ }: React$1.ComponentProps<'button'> & {
89
+ index: number;
90
+ }): react_jsx_runtime10.JSX.Element;
71
91
  //#endregion
72
92
  //#region src/ui-client/dialog/dialog.d.ts
73
93
  declare const classes: (props?: ({
@@ -91,7 +111,7 @@ declare function Dialog({
91
111
  onClose,
92
112
  children,
93
113
  ...rest
94
- }: DialogProps): react_jsx_runtime2.JSX.Element | null;
114
+ }: DialogProps): react_jsx_runtime10.JSX.Element | null;
95
115
  //#endregion
96
116
  //#region src/ui-client/image/image.d.ts
97
117
  type ImageSubsetProps = {
@@ -102,7 +122,7 @@ type ImageSubsetProps = {
102
122
  skeletonClassName?: string;
103
123
  };
104
124
  type ImageProps = UseSubsetImageProps & ImageSubsetProps;
105
- declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
125
+ declare const BaseImage: react1.ForwardRefExoticComponent<(Omit<BaseProps & {
106
126
  fill: true;
107
127
  sizes: string;
108
128
  width?: never;
@@ -112,8 +132,8 @@ declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
112
132
  sizes?: never;
113
133
  width: number;
114
134
  height: number;
115
- }, "ref">) & react3.RefAttributes<HTMLImageElement>>;
116
- declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
135
+ }, "ref">) & react1.RefAttributes<HTMLImageElement>>;
136
+ declare const Image: react1.ForwardRefExoticComponent<(Omit<BaseProps & {
117
137
  fill: true;
118
138
  sizes: string;
119
139
  width?: never;
@@ -123,7 +143,7 @@ declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
123
143
  sizes?: never;
124
144
  width: number;
125
145
  height: number;
126
- } & ImageSubsetProps, "ref">) & react3.RefAttributes<HTMLImageElement>>;
146
+ } & ImageSubsetProps, "ref">) & react1.RefAttributes<HTMLImageElement>>;
127
147
  interface EmptyNodeProps {
128
148
  children: React.ReactNode;
129
149
  className?: string;
@@ -131,7 +151,7 @@ interface EmptyNodeProps {
131
151
  declare const EmptyNode: ({
132
152
  children,
133
153
  className
134
- }: EmptyNodeProps) => react_jsx_runtime2.JSX.Element;
154
+ }: EmptyNodeProps) => react_jsx_runtime10.JSX.Element;
135
155
  //#endregion
136
156
  //#region src/ui-client/sheet/sheet.d.ts
137
157
  type Direction = 'top' | 'bottom' | 'left' | 'right';
@@ -155,7 +175,7 @@ declare function Sheet({
155
175
  className,
156
176
  closeOnBackdropClick,
157
177
  zIndex
158
- }: SheetProps): react_jsx_runtime2.JSX.Element | null;
178
+ }: SheetProps): react_jsx_runtime10.JSX.Element | null;
159
179
  //#endregion
160
180
  //#region src/ui-client/tooltip/tooltip-container.d.ts
161
181
  type SubPlacement = 'start' | 'end';
@@ -167,6 +187,6 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
167
187
  placement?: TooltipPlacement;
168
188
  defaultOpen?: boolean;
169
189
  }
170
- declare const TooltipContainer: react3.ForwardRefExoticComponent<TooltipContainerProps & react3.RefAttributes<HTMLDivElement>>;
190
+ declare const TooltipContainer: react1.ForwardRefExoticComponent<TooltipContainerProps & react1.RefAttributes<HTMLDivElement>>;
171
191
  //#endregion
172
- export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
192
+ export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselDots as CarouselDot, CarouselDots$1 as CarouselDots, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
@@ -1,7 +1,7 @@
1
1
  import { a as UseSubsetImageProps, n as BaseProps } from "../index-ByfkW7VU.mjs";
2
2
  import * as react3 from "react";
3
3
  import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
4
- import * as react_jsx_runtime3 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
5
5
  import { VariantProps } from "class-variance-authority";
6
6
  import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
7
7
  import * as class_variance_authority_types0 from "class-variance-authority/types";
@@ -24,6 +24,9 @@ type CarouselContextProps = {
24
24
  scrollNext: () => void;
25
25
  canScrollPrev: boolean;
26
26
  canScrollNext: boolean;
27
+ scrollTo: (index: number) => void;
28
+ dots: number;
29
+ selectedScrollSnap: number;
27
30
  } & CarouselProps;
28
31
  //#endregion
29
32
  //#region src/ui-client/carousel/carousel.d.ts
@@ -41,33 +44,50 @@ declare function Carousel({
41
44
  className,
42
45
  children,
43
46
  ...props
44
- }: CarouselProps$1): react_jsx_runtime3.JSX.Element;
47
+ }: CarouselProps$1): react_jsx_runtime1.JSX.Element;
45
48
  //#endregion
46
49
  //#region src/ui-client/carousel/carousel-wrapper.d.ts
47
50
  declare function CarouselWrapper({
48
51
  className,
49
52
  ...props
50
- }: React$1.ComponentProps<'div'>): react_jsx_runtime3.JSX.Element;
53
+ }: React$1.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
51
54
  //#endregion
52
55
  //#region src/ui-client/carousel/carousel-item.d.ts
53
56
  declare function CarouselItem({
54
57
  className,
55
58
  ...props
56
- }: React$1.ComponentProps<'div'>): react_jsx_runtime3.JSX.Element;
59
+ }: React$1.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
57
60
  //#endregion
58
61
  //#region src/ui-client/carousel/carousel-previous.d.ts
59
62
  declare function CarouselPrevious({
60
63
  children,
61
64
  className,
62
65
  ...props
63
- }: React$1.ComponentProps<'button'>): react_jsx_runtime3.JSX.Element;
66
+ }: React$1.ComponentProps<'button'>): react_jsx_runtime1.JSX.Element;
64
67
  //#endregion
65
68
  //#region src/ui-client/carousel/carousel-next.d.ts
66
69
  declare function CarouselNext({
67
70
  children,
68
71
  className,
69
72
  ...props
70
- }: React$1.ComponentProps<'button'>): react_jsx_runtime3.JSX.Element;
73
+ }: React$1.ComponentProps<'button'>): react_jsx_runtime1.JSX.Element;
74
+ //#endregion
75
+ //#region src/ui-client/carousel/carousel-dots.d.ts
76
+ declare function CarouselDots$1({
77
+ children,
78
+ ...props
79
+ }: Omit<React$1.ComponentProps<'button'>, 'children'> & {
80
+ children?: (index: number) => React$1.ReactNode;
81
+ }): react_jsx_runtime1.JSX.Element;
82
+ //#endregion
83
+ //#region src/ui-client/carousel/carousel-dot.d.ts
84
+ declare function CarouselDots({
85
+ index,
86
+ children,
87
+ ...props
88
+ }: React$1.ComponentProps<'button'> & {
89
+ index: number;
90
+ }): react_jsx_runtime1.JSX.Element;
71
91
  //#endregion
72
92
  //#region src/ui-client/dialog/dialog.d.ts
73
93
  declare const classes: (props?: ({
@@ -91,7 +111,7 @@ declare function Dialog({
91
111
  onClose,
92
112
  children,
93
113
  ...rest
94
- }: DialogProps): react_jsx_runtime3.JSX.Element | null;
114
+ }: DialogProps): react_jsx_runtime1.JSX.Element | null;
95
115
  //#endregion
96
116
  //#region src/ui-client/image/image.d.ts
97
117
  type ImageSubsetProps = {
@@ -131,7 +151,7 @@ interface EmptyNodeProps {
131
151
  declare const EmptyNode: ({
132
152
  children,
133
153
  className
134
- }: EmptyNodeProps) => react_jsx_runtime3.JSX.Element;
154
+ }: EmptyNodeProps) => react_jsx_runtime1.JSX.Element;
135
155
  //#endregion
136
156
  //#region src/ui-client/sheet/sheet.d.ts
137
157
  type Direction = 'top' | 'bottom' | 'left' | 'right';
@@ -155,7 +175,7 @@ declare function Sheet({
155
175
  className,
156
176
  closeOnBackdropClick,
157
177
  zIndex
158
- }: SheetProps): react_jsx_runtime3.JSX.Element | null;
178
+ }: SheetProps): react_jsx_runtime1.JSX.Element | null;
159
179
  //#endregion
160
180
  //#region src/ui-client/tooltip/tooltip-container.d.ts
161
181
  type SubPlacement = 'start' | 'end';
@@ -169,4 +189,4 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
169
189
  }
170
190
  declare const TooltipContainer: react3.ForwardRefExoticComponent<TooltipContainerProps & react3.RefAttributes<HTMLDivElement>>;
171
191
  //#endregion
172
- export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
192
+ export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselDots as CarouselDot, CarouselDots$1 as CarouselDots, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
@@ -1 +1 @@
1
- import"../src-C_FmOyer.mjs";import{y as e}from"../util-zXJA6Gnc.mjs";import{t}from"../skeleton-S6S1ZnCy.mjs";import{c as n,o as r,r as i}from"../hooks-DBo6LQrH.mjs";import"../providers-5JCPezAS.mjs";import a from"clsx";import o,{forwardRef as s,useCallback as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{cva as g}from"class-variance-authority";import _ from"embla-carousel-react";import{createPortal as v}from"react-dom";const y=o.createContext(null);function b(){let e=o.useContext(y);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function x({orientation:t=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:o,...s}){let[u,d]=_({...n,axis:t===`horizontal`?`x`:`y`},i),[p,h]=f(!1),[g,v]=f(!1),b=c(e=>{e&&(h(e.canScrollPrev()),v(e.canScrollNext()))},[]),x=c(()=>{d?.scrollPrev()},[d]),S=c(()=>{d?.scrollNext()},[d]),C=c(e=>{t===`horizontal`?e.key===`ArrowLeft`?(e.preventDefault(),x()):e.key===`ArrowRight`&&(e.preventDefault(),S()):e.key===`ArrowUp`?(e.preventDefault(),x()):e.key===`ArrowDown`&&(e.preventDefault(),S())},[x,S,t]);return l(()=>{!d||!r||r(d)},[d,r]),l(()=>{if(d)return b(d),d.on(`reInit`,b),d.on(`select`,b),()=>{d?.off(`select`,b)}},[d,b]),m(y.Provider,{value:{carouselRef:u,api:d,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:x,scrollNext:S,canScrollPrev:p,canScrollNext:g},children:m(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:C,className:e(`komc:relative`,a),...s,children:o})})}function S({className:t,...n}){let{carouselRef:r,orientation:i}=b();return m(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:m(`div`,{className:e(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,t),...n})})}function C({className:t,...n}){let{orientation:r}=b();return m(`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 w({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=b();return m(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:a(`komc:w-full`,t),onClick:r,...n,children:e})}function T({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=b();return m(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:a(`komc:w-full`,t),onClick:r,...n,children:e})}const E=g(`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 D({closeOnBackdropClick:e=!0,isOpen:t,zIndex:r=1e4,padding:i,maxWidth:a,className:o,onClose:s,children:u,...d}){let p=n(t,300),[g,_]=f(!1);l(()=>{if(t&&p){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else t||_(!1)},[t,p]);let v=c(e=>{e.key===`Escape`&&s()},[s]),y=c(()=>{e&&s()},[e,s]);return l(()=>(t?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[t,v]),p?m(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden`,style:{zIndex:r},children:h(`div`,{className:`komc:relative komc:flex komc:min-h-0 komc:flex-1 komc:w-full komc:items-center komc:justify-center`,children:[m(`button`,{type:`button`,"data-state":g?`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:y,"aria-label":`close dialog`}),m(`div`,{"data-state":g?`open`:`closed`,className:`${E({padding:i,maxWidth:a,className:o})} 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`,...d,children:u})]})}):null}const O=g(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),k=s(({...e},t)=>{let{ref:n,imageProps:r}=i({ref:t,...e});return m(`img`,{ref:n,...r})}),A=s(({skeleton:e=!0,layout:n=`stretch`,fallbackSrc:r,className:o,emptyNode:s,emptyNodeClassName:c,skeletonClassName:l,...u},d)=>{let{ref:f,isLoad:g,isError:_,imageProps:v}=i({ref:d,fallbackSrc:r,forceLoad:!e,...u}),y=!u.fill&&n===`intrinsic`?{width:`${u.width}px`,height:`${u.height}px`}:void 0,b=a(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!u.fill&&n===`stretch`&&`komc:w-full komc:h-full`);return!r&&_&&s?u.fill?m(j,{className:c,children:s}):m(`div`,{"data-komc":!0,style:y,className:b,children:m(j,{className:c,children:s})}):u.fill?h(p,{children:[m(`img`,{ref:f,...v,className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:invisible`:`komc:visible`,o)}),m(`div`,{"data-komc":!0,className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:m(t,{size:`full`,className:l})})]}):h(`div`,{"data-komc":!0,style:y,className:b,children:[m(`img`,{ref:f,...v,className:a(O({fill:u.fill,className:o}),e&&!g?`komc:invisible`:`komc:visible`)}),m(`div`,{className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:m(t,{size:`full`,className:l})})]})}),j=({children:e,className:t})=>m(`div`,{"data-komc":!0,role:`alert`,className:a(`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 M=A;const N=g(a(`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`}}}),P=g(``,{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 F({isOpen:e,onClose:t,direction:r=`bottom`,size:i=`full`,children:o,className:s,closeOnBackdropClick:u=!0,zIndex:d=1001}){let p=n(e,300),[g,_]=f(!1);l(()=>{if(e&&p){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else e||_(!1)},[e,p]);let v=c(e=>{e.key===`Escape`&&t()},[t]),y=c(()=>{u&&t()},[u,t]);return l(()=>(e?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[e,v]),p?h(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[m(`button`,{type:`button`,"data-state":g?`open`:`closed`,className:a(`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:y,"aria-label":`close sheet`}),m(`div`,{"data-state":g?`open`:`closed`,className:a(N({direction:r,className:s}),P({direction:r,size:i})),role:`dialog`,"aria-modal":`true`,children:o})]}):null}function I({children:e,setOpen:t}){return m(`div`,{"data-komc":!0,className:a(`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=g(e(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var R=s(({portal:e,children:t,className:n,placement:r,...i},a)=>m(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:L({portal:e,placement:r,className:n}),...i,children:t}));const z=g(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var B=({placement:e,className:t,offset:n,style:r,...i})=>{let a=u(()=>{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 m(`div`,{className:z({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const V=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function H({placement:e,className:t,content:n,open:r,hiddenRef:i,containerRef:o}){let[s,u]=f(!1),[d,p]=f(e),[g,_]=f({top:0,left:0}),[y,b]=f({x:0,y:0});l(()=>{u(!0)},[]);let x=c(()=>{let t=o.current,n=i.current;if(!t||!n)return;let r=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=e,[c]=s.split(`-`),l=r.top,u=window.innerHeight-r.bottom;c===`bottom`&&u<a.height&&l>=a.height?s=V(s,`top`):c===`top`&&l<a.height&&u>=a.height&&(s=V(s,`bottom`)),p(s);let[d,f]=s.split(`-`),m=r.top,h=r.left+r.width/2-a.width/2;switch(d){case`top`:m-=a.height;break;case`bottom`:m+=r.height;break}switch(f){case`start`:h+=a.width/2-24;break;case`end`:h-=a.width/2-24;break}let g=h,v=window.innerWidth;g+a.width>v-4&&(g=v-a.width-4),g<4&&(g=4),_({top:m,left:g}),b({x:h-g,y:0})},[e,o,i]);return l(()=>{if(!s||!r)return;console.log(`updateLayout`);let e=!1,t=0,n=0,i=!1;x();let a=()=>{i||=(t=requestAnimationFrame(()=>{e||x(),i=!1}),!0)};window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let c=0,l=0,u=``,d=()=>{if(e||c>=180)return;let t=o.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===u?l+=1:(l=0,u=n,x())}l<2&&(c+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[s,r,x,o]),s?v(h(R,{portal:!0,"data-komc":!0,placement:d,className:a(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[m(`span`,{children:n}),m(B,{placement:d,offset:y})]}),document.body):null}var U=s(({children:e,content:t,defaultOpen:n=!1,className:i,placement:o=`top`},s)=>{let[c,l]=f(n),u=d(null),p=d(null);return r({ref:u,setOpen:l}),h(`div`,{ref:u,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[m(I,{setOpen:l,children:e}),m(H,{placement:o,className:i,open:c,content:t,hiddenRef:p,containerRef:u}),m(R,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:o,className:a(`komc:opacity-0 komc:invisible`,i),children:m(`span`,{children:t})})]})});export{k as BaseImage,x as Carousel,C as CarouselItem,T as CarouselNext,w as CarouselPrevious,S as CarouselWrapper,D as Dialog,j as EmptyNode,M as Image,F as Sheet,U as Tooltip};
1
+ import"../src-C_FmOyer.mjs";import{y as e}from"../util-zXJA6Gnc.mjs";import{t}from"../skeleton-S6S1ZnCy.mjs";import{c as n,o as r,r as i}from"../hooks-DBo6LQrH.mjs";import"../providers-5JCPezAS.mjs";import a from"clsx";import o,{forwardRef as s,useCallback as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{cva as g}from"class-variance-authority";import _ from"embla-carousel-react";import{createPortal as v}from"react-dom";const y=o.createContext(null);function b(){let e=o.useContext(y);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function x({orientation:t=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:o,...s}){let[u,d]=_({...n,axis:t===`horizontal`?`x`:`y`},i),[p,h]=f(!1),[g,v]=f(!1),[b,x]=f(0),[S,C]=f(0),w=c(e=>{e&&(h(e.canScrollPrev()),v(e.canScrollNext()),C(e.selectedScrollSnap()))},[]),T=c(()=>{d?.scrollPrev()},[d]),E=c(()=>{d?.scrollNext()},[d]),D=c(e=>{d?.scrollTo(e)},[d]),O=c(()=>{x(d?.scrollSnapList().length||0)},[d]),k=c(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 l(()=>{!d||!r||r(d)},[d,r]),l(()=>{if(d)return w(d),O(),d.on(`reInit`,O),d.on(`reInit`,w),d.on(`select`,w),()=>{d?.off(`select`,w)}},[d,w]),m(y.Provider,{value:{carouselRef:u,api:d,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:T,scrollNext:E,canScrollPrev:p,canScrollNext:g,scrollTo:D,dots:b,selectedScrollSnap:S},children:m(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:k,className:e(`komc:relative`,a),...s,children:o})})}function S({className:t,...n}){let{carouselRef:r,orientation:i}=b();return m(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:m(`div`,{className:e(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,t),...n})})}function C({className:t,...n}){let{orientation:r}=b();return m(`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 w({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=b();return m(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:a(`komc:w-full`,t),onClick:r,...n,children:e})}function T({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=b();return m(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:a(`komc:w-full`,t),onClick:r,...n,children:e})}function E({children:e,...t}){let{dots:n,selectedScrollSnap:r,scrollTo:i}=b();return m(p,{children:Array.from({length:n}).map((n,a)=>m(`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 D({index:e,children:t,...n}){let{selectedScrollSnap:r,scrollTo:i}=b();return m(`button`,{type:`button`,"data-komc":!0,"data-selected":r===e,"aria-label":`go to slide ${e+1}`,onClick:()=>i(e),...n,children:t})}const O=g(`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 k({closeOnBackdropClick:e=!0,isOpen:t,zIndex:r=1e4,padding:i,maxWidth:a,className:o,onClose:s,children:u,...d}){let p=n(t,300),[g,_]=f(!1);l(()=>{if(t&&p){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else t||_(!1)},[t,p]);let v=c(e=>{e.key===`Escape`&&s()},[s]),y=c(()=>{e&&s()},[e,s]);return l(()=>(t?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[t,v]),p?m(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden`,style:{zIndex:r},children:h(`div`,{className:`komc:relative komc:flex komc:min-h-0 komc:flex-1 komc:w-full komc:items-center komc:justify-center`,children:[m(`button`,{type:`button`,"data-state":g?`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:y,"aria-label":`close dialog`}),m(`div`,{"data-state":g?`open`:`closed`,className:`${O({padding:i,maxWidth:a,className:o})} 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`,...d,children:u})]})}):null}const A=g(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),j=s(({...e},t)=>{let{ref:n,imageProps:r}=i({ref:t,...e});return m(`img`,{ref:n,...r})}),M=s(({skeleton:e=!0,layout:n=`stretch`,fallbackSrc:r,className:o,emptyNode:s,emptyNodeClassName:c,skeletonClassName:l,...u},d)=>{let{ref:f,isLoad:g,isError:_,imageProps:v}=i({ref:d,fallbackSrc:r,forceLoad:!e,...u}),y=!u.fill&&n===`intrinsic`?{width:`${u.width}px`,height:`${u.height}px`}:void 0,b=a(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!u.fill&&n===`stretch`&&`komc:w-full komc:h-full`);return!r&&_&&s?u.fill?m(N,{className:c,children:s}):m(`div`,{"data-komc":!0,style:y,className:b,children:m(N,{className:c,children:s})}):u.fill?h(p,{children:[m(`img`,{ref:f,...v,className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:invisible`:`komc:visible`,o)}),m(`div`,{"data-komc":!0,className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:m(t,{size:`full`,className:l})})]}):h(`div`,{"data-komc":!0,style:y,className:b,children:[m(`img`,{ref:f,...v,className:a(A({fill:u.fill,className:o}),e&&!g?`komc:invisible`:`komc:visible`)}),m(`div`,{className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:m(t,{size:`full`,className:l})})]})}),N=({children:e,className:t})=>m(`div`,{"data-komc":!0,role:`alert`,className:a(`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 P=M;const F=g(a(`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`}}}),I=g(``,{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 L({isOpen:e,onClose:t,direction:r=`bottom`,size:i=`full`,children:o,className:s,closeOnBackdropClick:u=!0,zIndex:d=1001}){let p=n(e,300),[g,_]=f(!1);l(()=>{if(e&&p){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else e||_(!1)},[e,p]);let v=c(e=>{e.key===`Escape`&&t()},[t]),y=c(()=>{u&&t()},[u,t]);return l(()=>(e?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[e,v]),p?h(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[m(`button`,{type:`button`,"data-state":g?`open`:`closed`,className:a(`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:y,"aria-label":`close sheet`}),m(`div`,{"data-state":g?`open`:`closed`,className:a(F({direction:r,className:s}),I({direction:r,size:i})),role:`dialog`,"aria-modal":`true`,children:o})]}):null}function R({children:e,setOpen:t}){return m(`div`,{"data-komc":!0,className:a(`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 z=g(e(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var B=s(({portal:e,children:t,className:n,placement:r,...i},a)=>m(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:z({portal:e,placement:r,className:n}),...i,children:t}));const V=g(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var H=({placement:e,className:t,offset:n,style:r,...i})=>{let a=u(()=>{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 m(`div`,{className:V({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const U=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function W({placement:e,className:t,content:n,open:r,hiddenRef:i,containerRef:o}){let[s,u]=f(!1),[d,p]=f(e),[g,_]=f({top:0,left:0}),[y,b]=f({x:0,y:0});l(()=>{u(!0)},[]);let x=c(()=>{let t=o.current,n=i.current;if(!t||!n)return;let r=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=e,[c]=s.split(`-`),l=r.top,u=window.innerHeight-r.bottom;c===`bottom`&&u<a.height&&l>=a.height?s=U(s,`top`):c===`top`&&l<a.height&&u>=a.height&&(s=U(s,`bottom`)),p(s);let[d,f]=s.split(`-`),m=r.top,h=r.left+r.width/2-a.width/2;switch(d){case`top`:m-=a.height;break;case`bottom`:m+=r.height;break}switch(f){case`start`:h+=a.width/2-24;break;case`end`:h-=a.width/2-24;break}let g=h,v=window.innerWidth;g+a.width>v-4&&(g=v-a.width-4),g<4&&(g=4),_({top:m,left:g}),b({x:h-g,y:0})},[e,o,i]);return l(()=>{if(!s||!r)return;console.log(`updateLayout`);let e=!1,t=0,n=0,i=!1;x();let a=()=>{i||=(t=requestAnimationFrame(()=>{e||x(),i=!1}),!0)};window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let c=0,l=0,u=``,d=()=>{if(e||c>=180)return;let t=o.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===u?l+=1:(l=0,u=n,x())}l<2&&(c+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[s,r,x,o]),s?v(h(B,{portal:!0,"data-komc":!0,placement:d,className:a(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[m(`span`,{children:n}),m(H,{placement:d,offset:y})]}),document.body):null}var G=s(({children:e,content:t,defaultOpen:n=!1,className:i,placement:o=`top`},s)=>{let[c,l]=f(n),u=d(null),p=d(null);return r({ref:u,setOpen:l}),h(`div`,{ref:u,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[m(R,{setOpen:l,children:e}),m(W,{placement:o,className:i,open:c,content:t,hiddenRef:p,containerRef:u}),m(B,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:o,className:a(`komc:opacity-0 komc:invisible`,i),children:m(`span`,{children:t})})]})});export{j as BaseImage,x as Carousel,D as CarouselDot,E as CarouselDots,C as CarouselItem,T as CarouselNext,w as CarouselPrevious,S as CarouselWrapper,k as Dialog,N as EmptyNode,P as Image,L as Sheet,G as Tooltip};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinerd/js-module",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.mjs",