@machinerd/js-module 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -6
- package/dist/{api-client-C0sbSOQf.mjs → api-client-B-kwZogn.mjs} +1 -1
- package/dist/hooks/common/index.cjs +1 -1
- package/dist/hooks/common/index.d.cts +6 -7
- package/dist/hooks/common/index.d.mts +6 -7
- package/dist/hooks/common/index.mjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/providers/api-client/index.cjs +1 -1
- package/dist/providers/api-client/index.d.cts +3 -3
- package/dist/providers/api-client/index.d.mts +3 -3
- package/dist/providers/api-client/index.mjs +1 -1
- package/dist/providers/noti-stack/index.d.cts +2 -2
- package/dist/{skeleton-Y22bmaaB.mjs → skeleton-azZrk5-3.mjs} +1 -1
- package/dist/styles/index.css +0 -251
- package/dist/ui/carousel/index.cjs +1 -1
- package/dist/ui/carousel/index.d.cts +9 -9
- package/dist/ui/carousel/index.d.mts +9 -9
- package/dist/ui/carousel/index.mjs +1 -1
- package/dist/ui/dialog/index.cjs +1 -1
- package/dist/ui/dialog/index.d.cts +2 -2
- package/dist/ui/dialog/index.d.mts +4 -4
- package/dist/ui/dialog/index.mjs +1 -1
- package/dist/ui/dnd/index.d.cts +2 -2
- package/dist/ui/image/index.cjs +1 -1
- package/dist/ui/image/index.d.cts +8 -8
- package/dist/ui/image/index.d.mts +8 -8
- package/dist/ui/image/index.mjs +1 -1
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +55 -12
- package/dist/ui/index.d.mts +58 -15
- package/dist/ui/index.mjs +1 -1
- package/dist/ui/motion-dialog/index.cjs +1 -1
- package/dist/ui/motion-dialog/index.mjs +1 -1
- package/dist/ui/sheet/index.cjs +1 -1
- package/dist/ui/sheet/index.d.cts +2 -2
- package/dist/ui/sheet/index.d.mts +2 -2
- package/dist/ui/sheet/index.mjs +1 -1
- package/dist/ui/switch/index.cjs +1 -1
- package/dist/ui/switch/index.mjs +1 -1
- package/dist/ui/tooltip/index.cjs +1 -1
- package/dist/ui/tooltip/index.d.cts +2 -2
- package/dist/ui/tooltip/index.mjs +1 -1
- package/dist/{use-subset-image-o_gmC1HL.cjs → use-subset-image-CTy5mCLo.cjs} +1 -1
- package/dist/{use-subset-image-Df2fCrtH.mjs → use-subset-image-LQWsE5P4.mjs} +1 -1
- package/dist/util/common.mjs +1 -1
- package/dist/util/file.mjs +1 -1
- package/dist/util/format.cjs +1 -1
- package/dist/util/format.d.cts +1 -29
- package/dist/util/format.d.mts +1 -29
- package/dist/util/format.mjs +1 -1
- package/package.json +4 -42
- package/dist/button-CQZuaIU7.mjs +0 -1
- package/dist/button-ChX3XGbR.cjs +0 -1
- package/dist/button-DHvx-GAg.d.cts +0 -50
- package/dist/button-DRIyBtEB.d.mts +0 -50
- package/dist/editor/index.cjs +0 -1
- package/dist/editor/index.d.cts +0 -80
- package/dist/editor/index.d.mts +0 -80
- package/dist/editor/index.mjs +0 -1
- package/dist/format-1_RTNUQv.mjs +0 -1
- package/dist/format-DEuImTYJ.cjs +0 -1
- package/dist/styles/editor.css +0 -255
- package/dist/ui/dropdown/index.cjs +0 -1
- package/dist/ui/dropdown/index.d.cts +0 -72
- package/dist/ui/dropdown/index.d.mts +0 -72
- package/dist/ui/dropdown/index.mjs +0 -1
- package/dist/ui/preserve-focus-button/index.cjs +0 -1
- package/dist/ui/preserve-focus-button/index.d.cts +0 -12
- package/dist/ui/preserve-focus-button/index.d.mts +0 -12
- package/dist/ui/preserve-focus-button/index.mjs +0 -1
- package/dist/ui-Bs9PP9eC.cjs +0 -1
- package/dist/ui-D2DoC_0E.mjs +0 -1
- package/dist/use-drag-resize-BdeLdulk.mjs +0 -1
- package/dist/use-drag-resize-DEgcua2U.d.cts +0 -48
- package/dist/use-drag-resize-DRHPv5RK.d.mts +0 -48
- package/dist/use-drag-resize-DeDqPC4h.cjs +0 -1
- package/dist/util/editor.cjs +0 -1
- package/dist/util/editor.d.cts +0 -21
- package/dist/util/editor.d.mts +0 -21
- package/dist/util/editor.mjs +0 -1
- /package/dist/{api-client-C3o2pO0q.cjs → api-client-BH5tW3p8.cjs} +0 -0
- /package/dist/{common-B8HXyhZa.cjs → common-BQEGjmFn.cjs} +0 -0
- /package/dist/{common-ZUMpASnc.mjs → common-CCtD91nO.mjs} +0 -0
- /package/dist/{common-CWHkXe0F.mjs → common-L3y7_eAy.mjs} +0 -0
- /package/dist/{file-B-UJkabO.mjs → file-CjW1pMb_.mjs} +0 -0
- /package/dist/{index-B1YNV_Vm.d.cts → index-CFOJBfVt.d.mts} +0 -0
- /package/dist/{index-C8chDULk.d.mts → index-ChiDX5zW.d.cts} +0 -0
- /package/dist/{skeleton-B5ZccRFX.cjs → skeleton-BCdxpynL.cjs} +0 -0
- /package/dist/{src-CIMlbgv1.mjs → src-Ce2i3Lkj.mjs} +0 -0
- /package/dist/{use-dialog-stack-YiLs-sNf.cjs → use-dialog-stack-DmBRPhe2.cjs} +0 -0
- /package/dist/{use-dialog-stack-Crj8YWJl.mjs → use-dialog-stack-STwnhvBB.mjs} +0 -0
- /package/dist/{use-subset-image-Dygkyw-W.d.mts → use-subset-image-Ck1Gk5Qk.d.mts} +0 -0
- /package/dist/{use-subset-image-bDB5TSd4.d.cts → use-subset-image-oZAiC9VK.d.cts} +0 -0
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
1
|
+
import * as react9 from "react";
|
|
2
|
+
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
5
4
|
import { VariantProps } from "class-variance-authority";
|
|
6
|
-
import * as
|
|
5
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
7
6
|
|
|
8
7
|
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
9
8
|
interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
|
|
@@ -17,6 +16,50 @@ declare function BottomAppBar<T>({
|
|
|
17
16
|
...props
|
|
18
17
|
}: BottomAppBarProps<T>): React$1.ReactNode;
|
|
19
18
|
//#endregion
|
|
19
|
+
//#region src/ui/button/button.d.ts
|
|
20
|
+
declare const classes$2: (props?: ({
|
|
21
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xxs" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
22
|
+
shadow?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | null | undefined;
|
|
23
|
+
outline?: "line" | "solid" | "clear" | null | undefined;
|
|
24
|
+
variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
|
|
25
|
+
px?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
26
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "none" | "3xl" | null | undefined;
|
|
27
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
28
|
+
interface VariantMap {
|
|
29
|
+
line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
|
|
30
|
+
solid: 'white' | 'gray' | 'blue' | 'night' | 'black' | 'sky' | 'sky-blue' | 'indigo';
|
|
31
|
+
clear: 'sky' | 'gray';
|
|
32
|
+
}
|
|
33
|
+
type BaseProps = Omit<VariantProps<typeof classes$2>, 'outline' | 'variant'>;
|
|
34
|
+
type ButtonProps = ComponentProps<'button'> & BaseProps & ({
|
|
35
|
+
outline?: 'line';
|
|
36
|
+
variant?: VariantMap['line'];
|
|
37
|
+
} | {
|
|
38
|
+
outline: 'solid';
|
|
39
|
+
variant?: VariantMap['solid'];
|
|
40
|
+
} | {
|
|
41
|
+
outline: 'clear';
|
|
42
|
+
variant?: VariantMap['clear'];
|
|
43
|
+
}) & {
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
};
|
|
46
|
+
declare const Button: react9.ForwardRefExoticComponent<(Omit<react9.ClassAttributes<HTMLButtonElement> & react9.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
47
|
+
outline?: "line";
|
|
48
|
+
variant?: VariantMap["line"];
|
|
49
|
+
} & {
|
|
50
|
+
asChild?: boolean;
|
|
51
|
+
}, "ref"> | Omit<react9.ClassAttributes<HTMLButtonElement> & react9.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
52
|
+
outline: "solid";
|
|
53
|
+
variant?: VariantMap["solid"];
|
|
54
|
+
} & {
|
|
55
|
+
asChild?: boolean;
|
|
56
|
+
}, "ref"> | Omit<react9.ClassAttributes<HTMLButtonElement> & react9.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
57
|
+
outline: "clear";
|
|
58
|
+
variant?: VariantMap["clear"];
|
|
59
|
+
} & {
|
|
60
|
+
asChild?: boolean;
|
|
61
|
+
}, "ref">) & react9.RefAttributes<HTMLButtonElement>>;
|
|
62
|
+
//#endregion
|
|
20
63
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
21
64
|
interface ConditionalWrapperProps {
|
|
22
65
|
condition: boolean;
|
|
@@ -27,7 +70,7 @@ declare function ConditionalWrapper({
|
|
|
27
70
|
condition,
|
|
28
71
|
wrapper,
|
|
29
72
|
children
|
|
30
|
-
}: ConditionalWrapperProps):
|
|
73
|
+
}: ConditionalWrapperProps): react9.ReactNode;
|
|
31
74
|
//#endregion
|
|
32
75
|
//#region src/ui/conditional-wrapper/conditional-either-wrapper.d.ts
|
|
33
76
|
interface ConditionalEitherWrapperProps {
|
|
@@ -41,15 +84,15 @@ declare function ConditionalEitherWrapper({
|
|
|
41
84
|
trueWrapper,
|
|
42
85
|
falseWrapper,
|
|
43
86
|
children
|
|
44
|
-
}: ConditionalEitherWrapperProps):
|
|
87
|
+
}: ConditionalEitherWrapperProps): react9.ReactNode;
|
|
45
88
|
//#endregion
|
|
46
89
|
//#region src/ui/input/input.d.ts
|
|
47
90
|
declare const classes$1: (props?: ({
|
|
48
91
|
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "base" | "xs" | "3xl" | null | undefined;
|
|
49
|
-
gap?: "sm" | "md" | "lg" | "
|
|
92
|
+
gap?: "sm" | "md" | "lg" | "xl" | "none" | "xs" | null | undefined;
|
|
50
93
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
51
|
-
rounded?: "sm" | "md" | "lg" | "
|
|
52
|
-
} &
|
|
94
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | null | undefined;
|
|
95
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
53
96
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
|
|
54
97
|
size?: VariantProps<typeof classes$1>['size'];
|
|
55
98
|
gap?: VariantProps<typeof classes$1>['gap'];
|
|
@@ -58,13 +101,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
58
101
|
prefix?: React.ReactNode;
|
|
59
102
|
surffix?: React.ReactNode;
|
|
60
103
|
}
|
|
61
|
-
declare const Input:
|
|
104
|
+
declare const Input: react9.ForwardRefExoticComponent<InputProps & react9.RefAttributes<HTMLInputElement>>;
|
|
62
105
|
//#endregion
|
|
63
106
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
64
107
|
declare const classes: (props?: ({
|
|
65
108
|
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
|
|
66
|
-
rounded?: "sm" | "md" | "lg" | "
|
|
67
|
-
} &
|
|
109
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "none" | "3xl" | null | undefined;
|
|
110
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
68
111
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
69
112
|
width?: string | number;
|
|
70
113
|
height?: string | number;
|
|
@@ -78,7 +121,7 @@ declare function Skeleton({
|
|
|
78
121
|
height,
|
|
79
122
|
className,
|
|
80
123
|
...props
|
|
81
|
-
}: SkeletonProps):
|
|
124
|
+
}: SkeletonProps): react_jsx_runtime13.JSX.Element;
|
|
82
125
|
//#endregion
|
|
83
126
|
//#region src/ui/stable-text/stable-text.d.ts
|
|
84
127
|
declare function StableText({
|
|
@@ -87,6 +130,6 @@ declare function StableText({
|
|
|
87
130
|
...props
|
|
88
131
|
}: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
89
132
|
children: string | number;
|
|
90
|
-
}):
|
|
133
|
+
}): react_jsx_runtime13.JSX.Element;
|
|
91
134
|
//#endregion
|
|
92
135
|
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalEitherWrapper, type ConditionalEitherWrapperProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
|
package/dist/ui/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../common-
|
|
1
|
+
import{n as e}from"../common-CCtD91nO.mjs";import{t}from"../skeleton-azZrk5-3.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,"data-komc":!0,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}function p({condition:e,trueWrapper:t,falseWrapper:n,children:r}){return e?t(r):n(r)}const m=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 h=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:m({size:n,gap:r,outline:i,rounded:s,className:c}),children:[e,a(`input`,{ref:u,type:`text`,...l}),t]}));function g({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,p as ConditionalEitherWrapper,f as ConditionalWrapper,h as Input,t as Skeleton,g as StableText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../common-D4sUwkFd.cjs`),n=require(`../../use-dialog-stack-
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../common-D4sUwkFd.cjs`),n=require(`../../use-dialog-stack-DmBRPhe2.cjs`);let r=require(`react`);r=e.t(r);let i=require(`react/jsx-runtime`),a=require(`class-variance-authority`),o=require(`motion/react`),s=require(`react-dom`);const c={sm:`komc:max-w-md`,md:`komc:max-w-lg`,lg:`komc:max-w-2xl`,xl:`komc:max-w-4xl`,"2xl":`komc:max-w-6xl`,full:`komc:max-w-full komc:mx-4`},l={scale:{hidden:{opacity:0,scale:.8,y:20},visible:{opacity:1,scale:1,y:0,transition:{type:`spring`,damping:25,stiffness:300}},exit:{opacity:0,scale:.8,y:20,transition:{duration:.2}}},slide:{hidden:{opacity:0,x:300},visible:{opacity:1,x:0,transition:{type:`spring`,damping:25,stiffness:300}},exit:{opacity:0,x:300,transition:{duration:.3}}},fade:{hidden:{opacity:0},visible:{opacity:1,transition:{duration:.3}},exit:{opacity:0,transition:{duration:.2}}},"slide-up":{hidden:{opacity:0,y:100},visible:{opacity:1,y:0,transition:{type:`spring`,damping:25,stiffness:300}},exit:{opacity:0,y:100,transition:{duration:.3}}}},u={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},d=(0,a.cva)(`komc:flex komc:items-center komc:justify-between`,{variants:{padding:{none:void 0,sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`},border:{none:``,default:`komc:border-b komc:border-gray-200`},closeButtonPosition:{none:void 0,fixed:`komc:[&>button]:absolute komc:[&>button]:right-6 komc:[&>button]:top-10`}},defaultVariants:{padding:`lg`,border:`default`,closeButtonPosition:`none`}}),f=(0,r.forwardRef)(({isOpen:e,onClose:a,children:f,title:p,footer:m,size:h=`md`,animation:g=`scale`,showCloseButton:_=!0,closeOnBackdropClick:v=!0,className:y=``,showBackdrop:b=!0,isScrollableContent:x=!1,zIndex:S=1e4,customAnimation:C,headerClassName:w,onExitComplete:T},E)=>{let D=(0,r.useId)(),[O,k]=(0,r.useState)(!1);n.t(e,a),(0,r.useEffect)(()=>{k(!0)},[]);let A=()=>{v&&a()},j=C||l[g];return O?(0,s.createPortal)((0,i.jsx)(o.AnimatePresence,{mode:`wait`,onExitComplete:T,children:e&&(0,i.jsxs)(o.motion.div,{"data-komc":!0,"data-komc-dialog":``,className:`komc:fixed komc:inset-0 komc:flex komc:items-center komc:justify-center komc:p-4`,style:{zIndex:S},variants:u,initial:`hidden`,animate:`visible`,exit:`exit`,children:[b&&(0,i.jsx)(o.motion.div,{className:`komc:absolute komc:bg-black/50`,style:{zIndex:-1,top:`50%`,left:`50%`,width:`100vw`,height:`100vh`,transform:`translate(-50%, -50%)`},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:A}),(0,i.jsxs)(o.motion.div,{ref:E,id:D,className:t.n(`komc:relative komc:bg-white komc:rounded-lg komc:shadow-xl komc:pointer-events-auto`,h===`full`?`komc:w-full komc:h-full`:t.n(c[h],`komc:w-full`),y),variants:j,initial:`hidden`,animate:`visible`,exit:`exit`,layout:!0,children:[(p||_)&&(0,i.jsxs)(o.motion.div,{className:d({padding:w?.padding,border:w?.border,closeButtonPosition:w?.closeButtonPosition}),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1},children:[p&&(typeof p==`string`?(0,i.jsx)(`h2`,{className:`komc:text-lg komc:font-semibold komc:text-gray-900`,children:p}):p),_&&(0,i.jsx)(o.motion.button,{onClick:a,className:`komc:p-1 komc:rounded-full komc:hover:bg-gray-100 komc:transition-colors`,"aria-label":`Close dialog`,whileHover:{scale:1.1},whileTap:{scale:.9},children:(0,i.jsx)(`svg`,{className:`komc:w-5 komc:h-5 komc:text-neutral-500`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]}),(0,i.jsx)(o.motion.div,{className:t.n(`komc:@container/dialog-content`,`komc:p-6`,x&&`komc:overflow-y-auto komc:h-(--dialog-content-height)`),initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:f}),m&&(0,i.jsx)(o.motion.div,{className:`komc:flex komc:items-center komc:justify-between komc:p-6 komc:border-t komc:border-gray-200`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},children:m})]})]})}),document.body):null});var p=f;exports.MotionDialog=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{n as e}from"../../common-
|
|
1
|
+
"use client";import{n as e}from"../../common-CCtD91nO.mjs";import{t}from"../../use-dialog-stack-STwnhvBB.mjs";import n,{forwardRef as r,useEffect as i,useId as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{cva as l}from"class-variance-authority";import{AnimatePresence as u,motion as d}from"motion/react";import{createPortal as f}from"react-dom";const p={sm:`komc:max-w-md`,md:`komc:max-w-lg`,lg:`komc:max-w-2xl`,xl:`komc:max-w-4xl`,"2xl":`komc:max-w-6xl`,full:`komc:max-w-full komc:mx-4`},m={scale:{hidden:{opacity:0,scale:.8,y:20},visible:{opacity:1,scale:1,y:0,transition:{type:`spring`,damping:25,stiffness:300}},exit:{opacity:0,scale:.8,y:20,transition:{duration:.2}}},slide:{hidden:{opacity:0,x:300},visible:{opacity:1,x:0,transition:{type:`spring`,damping:25,stiffness:300}},exit:{opacity:0,x:300,transition:{duration:.3}}},fade:{hidden:{opacity:0},visible:{opacity:1,transition:{duration:.3}},exit:{opacity:0,transition:{duration:.2}}},"slide-up":{hidden:{opacity:0,y:100},visible:{opacity:1,y:0,transition:{type:`spring`,damping:25,stiffness:300}},exit:{opacity:0,y:100,transition:{duration:.3}}}},h={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},g=l(`komc:flex komc:items-center komc:justify-between`,{variants:{padding:{none:void 0,sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`},border:{none:``,default:`komc:border-b komc:border-gray-200`},closeButtonPosition:{none:void 0,fixed:`komc:[&>button]:absolute komc:[&>button]:right-6 komc:[&>button]:top-10`}},defaultVariants:{padding:`lg`,border:`default`,closeButtonPosition:`none`}});var _=r(({isOpen:n,onClose:r,children:l,title:_,footer:v,size:y=`md`,animation:b=`scale`,showCloseButton:x=!0,closeOnBackdropClick:S=!0,className:C=``,showBackdrop:w=!0,isScrollableContent:T=!1,zIndex:E=1e4,customAnimation:D,headerClassName:O,onExitComplete:k},A)=>{let j=a(),[M,N]=o(!1);t(n,r),i(()=>{N(!0)},[]);let P=()=>{S&&r()},F=D||m[b];return M?f(s(u,{mode:`wait`,onExitComplete:k,children:n&&c(d.div,{"data-komc":!0,"data-komc-dialog":``,className:`komc:fixed komc:inset-0 komc:flex komc:items-center komc:justify-center komc:p-4`,style:{zIndex:E},variants:h,initial:`hidden`,animate:`visible`,exit:`exit`,children:[w&&s(d.div,{className:`komc:absolute komc:bg-black/50`,style:{zIndex:-1,top:`50%`,left:`50%`,width:`100vw`,height:`100vh`,transform:`translate(-50%, -50%)`},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:P}),c(d.div,{ref:A,id:j,className:e(`komc:relative komc:bg-white komc:rounded-lg komc:shadow-xl komc:pointer-events-auto`,y===`full`?`komc:w-full komc:h-full`:e(p[y],`komc:w-full`),C),variants:F,initial:`hidden`,animate:`visible`,exit:`exit`,layout:!0,children:[(_||x)&&c(d.div,{className:g({padding:O?.padding,border:O?.border,closeButtonPosition:O?.closeButtonPosition}),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1},children:[_&&(typeof _==`string`?s(`h2`,{className:`komc:text-lg komc:font-semibold komc:text-gray-900`,children:_}):_),x&&s(d.button,{onClick:r,className:`komc:p-1 komc:rounded-full komc:hover:bg-gray-100 komc:transition-colors`,"aria-label":`Close dialog`,whileHover:{scale:1.1},whileTap:{scale:.9},children:s(`svg`,{className:`komc:w-5 komc:h-5 komc:text-neutral-500`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:s(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]}),s(d.div,{className:e(`komc:@container/dialog-content`,`komc:p-6`,T&&`komc:overflow-y-auto komc:h-(--dialog-content-height)`),initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:l}),v&&s(d.div,{className:`komc:flex komc:items-center komc:justify-between komc:p-6 komc:border-t komc:border-gray-200`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},children:v})]})]})}),document.body):null});export{_ as MotionDialog};
|
package/dist/ui/sheet/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-6KfzqI9Z.cjs`),require(`../../file-5mweNdAM.cjs`)
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-6KfzqI9Z.cjs`),require(`../../file-5mweNdAM.cjs`);const t=require(`../../common-BQEGjmFn.cjs`),n=require(`../../use-dialog-stack-DmBRPhe2.cjs`);require(`../../api-client-BH5tW3p8.cjs`),require(`../../use-subset-image-CTy5mCLo.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`);const s=(0,o.cva)((0,r.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`}}}),c=(0,o.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 l({isOpen:e,onClose:o,direction:l=`bottom`,size:u=`full`,children:d,className:f,closeOnBackdropClick:p=!0,zIndex:m=1001}){let h=t.l(e,300),[g,_]=(0,i.useState)(!1);n.t(e,o),(0,i.useEffect)(()=>{if(e&&h){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else e||_(!1)},[e,h]);let v=(0,i.useCallback)(()=>{p&&o()},[p,o]);return h?(0,a.jsxs)(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:m},children:[(0,a.jsx)(`button`,{type:`button`,"data-state":g?`open`:`closed`,className:(0,r.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,a.jsx)(`div`,{"data-state":g?`open`:`closed`,className:(0,r.default)(s({direction:l,className:f}),c({direction:l,size:u})),role:`dialog`,"aria-modal":`true`,children:d})]}):null}exports.Sheet=l;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/ui/sheet/sheet.d.ts
|
|
5
5
|
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -23,6 +23,6 @@ declare function Sheet({
|
|
|
23
23
|
className,
|
|
24
24
|
closeOnBackdropClick,
|
|
25
25
|
zIndex
|
|
26
|
-
}: SheetProps):
|
|
26
|
+
}: SheetProps): react_jsx_runtime2.JSX.Element | null;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { Sheet, type SheetProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/ui/sheet/sheet.d.ts
|
|
5
5
|
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -23,6 +23,6 @@ declare function Sheet({
|
|
|
23
23
|
className,
|
|
24
24
|
closeOnBackdropClick,
|
|
25
25
|
zIndex
|
|
26
|
-
}: SheetProps):
|
|
26
|
+
}: SheetProps): react_jsx_runtime11.JSX.Element | null;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { Sheet, type SheetProps };
|
package/dist/ui/sheet/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"../../src-
|
|
1
|
+
"use client";import"../../src-Ce2i3Lkj.mjs";import"../../file-CjW1pMb_.mjs";import{l as e}from"../../common-L3y7_eAy.mjs";import{t}from"../../use-dialog-stack-STwnhvBB.mjs";import"../../api-client-B-kwZogn.mjs";import"../../use-subset-image-LQWsE5P4.mjs";import n from"clsx";import r,{useCallback as i,useEffect as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{cva as l}from"class-variance-authority";const u=l(n(`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=l(``,{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:r,onClose:l,direction:f=`bottom`,size:p=`full`,children:m,className:h,closeOnBackdropClick:g=!0,zIndex:_=1001}){let v=e(r,300),[y,b]=o(!1);t(r,l),a(()=>{if(r&&v){let e=setTimeout(()=>b(!0),10);return()=>clearTimeout(e)}else r||b(!1)},[r,v]);let x=i(()=>{g&&l()},[g,l]);return v?c(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:_},children:[s(`button`,{type:`button`,"data-state":y?`open`:`closed`,className:n(`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`}),s(`div`,{"data-state":y?`open`:`closed`,className:n(u({direction:f,className:h}),d({direction:f,size:p})),role:`dialog`,"aria-modal":`true`,children:m})]}):null}export{f as Sheet};
|
package/dist/ui/switch/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);let t=require(`
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);let t=require(`clsx`);t=e.t(t);let n=require(`react`);n=e.t(n);let r=require(`react/jsx-runtime`),i=require(`class-variance-authority`);const a=(0,i.cva)((0,t.default)(`komc:inline-flex komc:items-center`),{variants:{placement:{top:`komc:flex-col-reverse komc:gap-y-2.5`,bottom:`komc:flex-col komc:gap-y-2.5`,start:`komc:flex-row-reverse komc:gap-x-2`,end:`komc:flex-row komc:gap-x-2`},disabled:{false:`komc:cursor-pointer`,true:`komc:cursor-default komc:opacity-50`},checked:{false:`komc:[&>button]:bg-gray-300 komc:[&_span]:translate-x-0.5`,true:`komc:[&>button]:bg-blue-500 komc:[&_span]:translate-x-4.5`}},defaultVariants:{placement:`end`,disabled:!1,checked:!1}}),o=n.default.forwardRef(({label:e,placement:i=`end`,checked:o=!1,disabled:s=!1,onChange:c},l)=>{let u=(0,n.useId)(),d=()=>{s||c?.(!o)};return(0,r.jsxs)(`div`,{"data-komc":!0,className:(0,t.default)(a({placement:i,disabled:s,checked:o})),children:[(0,r.jsx)(`button`,{ref:l,id:u,type:`button`,role:`switch`,disabled:s,className:`komc:flex komc:items-center komc:rounded-full komc:transition komc:w-10 komc:h-6 komc:cursor-pointer komc:disabled:cursor-default`,"aria-checked":o,onClick:d,children:(0,r.jsx)(`span`,{className:`komc:size-5 komc:rounded-full komc:bg-white komc:transition komc:shadow-xs`})}),e?(0,r.jsx)(`label`,{htmlFor:u,className:`komc:text-xs komc:font-medium komc:text-neutral-500`,children:e}):null]})});exports.Switch=o;
|
package/dist/ui/switch/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import e,{useId as
|
|
1
|
+
"use client";import e from"clsx";import t,{useId as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(e(`komc:inline-flex komc:items-center`),{variants:{placement:{top:`komc:flex-col-reverse komc:gap-y-2.5`,bottom:`komc:flex-col komc:gap-y-2.5`,start:`komc:flex-row-reverse komc:gap-x-2`,end:`komc:flex-row komc:gap-x-2`},disabled:{false:`komc:cursor-pointer`,true:`komc:cursor-default komc:opacity-50`},checked:{false:`komc:[&>button]:bg-gray-300 komc:[&_span]:translate-x-0.5`,true:`komc:[&>button]:bg-blue-500 komc:[&_span]:translate-x-4.5`}},defaultVariants:{placement:`end`,disabled:!1,checked:!1}}),s=t.forwardRef(({label:t,placement:a=`end`,checked:s=!1,disabled:c=!1,onChange:l},u)=>{let d=n(),f=()=>{c||l?.(!s)};return i(`div`,{"data-komc":!0,className:e(o({placement:a,disabled:c,checked:s})),children:[r(`button`,{ref:u,id:d,type:`button`,role:`switch`,disabled:c,className:`komc:flex komc:items-center komc:rounded-full komc:transition komc:w-10 komc:h-6 komc:cursor-pointer komc:disabled:cursor-default`,"aria-checked":s,onClick:f,children:r(`span`,{className:`komc:size-5 komc:rounded-full komc:bg-white komc:transition komc:shadow-xs`})}),t?r(`label`,{htmlFor:d,className:`komc:text-xs komc:font-medium komc:text-neutral-500`,children:t}):null]})});export{s as Switch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-6KfzqI9Z.cjs`);const t=require(`../../common-D4sUwkFd.cjs`);require(`../../file-5mweNdAM.cjs`)
|
|
1
|
+
"use client";const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../src-6KfzqI9Z.cjs`);const t=require(`../../common-D4sUwkFd.cjs`);require(`../../file-5mweNdAM.cjs`);const n=require(`../../common-BQEGjmFn.cjs`);require(`../../use-dialog-stack-DmBRPhe2.cjs`),require(`../../api-client-BH5tW3p8.cjs`),require(`../../use-subset-image-CTy5mCLo.cjs`);let r=require(`clsx`);r=e.t(r);let i=require(`react`),a=require(`react/jsx-runtime`),o=require(`class-variance-authority`),s=require(`react-dom`);function c({children:e,setOpen:t}){return(0,a.jsx)(`div`,{"data-komc":!0,className:(0,r.default)(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const l=(0,o.cva)(t.n(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}}),u=(0,i.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},o)=>(0,a.jsx)(`div`,{ref:o,"data-komc":!0,role:`tooltip`,className:l({portal:e,placement:r,className:n}),...i,children:t}));var d=u;const f=(0,o.cva)(t.n(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.n(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.n(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":t.n(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.n(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.n(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.n(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}}),p=({placement:e,className:t,offset:n,...r})=>{let o=(0,i.useMemo)(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return(0,a.jsx)(`div`,{className:f({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${o}`},...r})};var m=p;const h=24,g=2,_=180,v=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function y({placement:e,className:t,content:n,open:o,hiddenRef:c,containerRef:l}){let[u,f]=(0,i.useState)(!1),[p,h]=(0,i.useState)(e),[g,_]=(0,i.useState)({top:0,left:0}),[y,b]=(0,i.useState)({x:0,y:0});(0,i.useEffect)(()=>{f(!0)},[]);let x=(0,i.useCallback)(()=>{let t=l.current,n=c.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),s=r.top,u=window.innerHeight-r.bottom;o===`bottom`&&u<i.height&&s>=i.height?a=v(a,`top`):o===`top`&&s<i.height&&u>=i.height&&(a=v(a,`bottom`)),h(a);let[d,f]=a.split(`-`),p=r.top,m=r.left+r.width/2-i.width/2;switch(d){case`top`:p-=i.height;break;case`bottom`:p+=r.height;break}switch(f){case`start`:m+=i.width/2-24;break;case`end`:m-=i.width/2-24;break}let g=m,y=window.innerWidth;g+i.width>y-4&&(g=y-i.width-4),g<4&&(g=4),_({top:p,left:g}),b({x:m-g,y:0})},[e,l,c]);return(0,i.useEffect)(()=>{if(!u||!o)return;console.log(`updateLayout`);let e=!1,t=0,n=0,r=!1;x();let i=()=>{r||=(t=requestAnimationFrame(()=>{e||x(),r=!1}),!0)};window.addEventListener(`scroll`,i,{passive:!0}),window.addEventListener(`resize`,i);let a=0,s=0,c=``,d=()=>{if(e||a>=180)return;let t=l.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===c?s+=1:(s=0,c=n,x())}s<2&&(a+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i)}},[u,o,x,l]),u?(0,s.createPortal)((0,a.jsxs)(d,{portal:!0,"data-komc":!0,placement:p,className:(0,r.default)(t,o?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[(0,a.jsx)(`span`,{children:n}),(0,a.jsx)(m,{placement:p,offset:y})]}),document.body):null}const b=(0,i.forwardRef)(({children:e,content:t,defaultOpen:o=!1,className:s,placement:l=`top`})=>{let[u,f]=(0,i.useState)(o),p=(0,i.useRef)(null),m=(0,i.useRef)(null);return n.a({ref:p,setOpen:f}),(0,a.jsxs)(`div`,{ref:p,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,a.jsx)(c,{setOpen:f,children:e}),(0,a.jsx)(y,{placement:l,className:s,open:u,content:t,hiddenRef:m,containerRef:p}),(0,a.jsx)(d,{ref:m,role:`presentation`,"aria-hidden":`true`,placement:l,className:(0,r.default)(`komc:opacity-0 komc:invisible`,s),children:(0,a.jsx)(`span`,{children:t})})]})});var x=b;exports.Tooltip=x;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react7 from "react";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ui/tooltip/tooltip-container.d.ts
|
|
@@ -11,6 +11,6 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
11
11
|
placement?: TooltipPlacement;
|
|
12
12
|
defaultOpen?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const TooltipContainer:
|
|
14
|
+
declare const TooltipContainer: react7.ForwardRefExoticComponent<TooltipContainerProps & react7.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"../../src-
|
|
1
|
+
"use client";import"../../src-Ce2i3Lkj.mjs";import{n as e}from"../../common-CCtD91nO.mjs";import"../../file-CjW1pMb_.mjs";import{a as t}from"../../common-L3y7_eAy.mjs";import"../../use-dialog-stack-STwnhvBB.mjs";import"../../api-client-B-kwZogn.mjs";import"../../use-subset-image-LQWsE5P4.mjs";import n from"clsx";import{forwardRef as r,useCallback as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{cva as d}from"class-variance-authority";import{createPortal as f}from"react-dom";function p({children:e,setOpen:t}){return l(`div`,{"data-komc":!0,className:n(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const m=d(e(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var h=r(({portal:e,children:t,className:n,placement:r,...i},a)=>l(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:m({portal:e,placement:r,className:n}),...i,children:t}));const g=d(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var _=({placement:e,className:t,offset:n,...r})=>{let i=o(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return l(`div`,{className:g({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${i}`},...r})};const v=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function y({placement:e,className:t,content:r,open:o,hiddenRef:s,containerRef:d}){let[p,m]=c(!1),[g,y]=c(e),[b,x]=c({top:0,left:0}),[S,C]=c({x:0,y:0});a(()=>{m(!0)},[]);let w=i(()=>{let t=d.current,n=s.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),c=r.top,l=window.innerHeight-r.bottom;o===`bottom`&&l<i.height&&c>=i.height?a=v(a,`top`):o===`top`&&c<i.height&&l>=i.height&&(a=v(a,`bottom`)),y(a);let[u,f]=a.split(`-`),p=r.top,m=r.left+r.width/2-i.width/2;switch(u){case`top`:p-=i.height;break;case`bottom`:p+=r.height;break}switch(f){case`start`:m+=i.width/2-24;break;case`end`:m-=i.width/2-24;break}let h=m,g=window.innerWidth;h+i.width>g-4&&(h=g-i.width-4),h<4&&(h=4),x({top:p,left:h}),C({x:m-h,y:0})},[e,d,s]);return a(()=>{if(!p||!o)return;console.log(`updateLayout`);let e=!1,t=0,n=0,r=!1;w();let i=()=>{r||=(t=requestAnimationFrame(()=>{e||w(),r=!1}),!0)};window.addEventListener(`scroll`,i,{passive:!0}),window.addEventListener(`resize`,i);let a=0,s=0,c=``,l=()=>{if(e||a>=180)return;let t=d.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===c?s+=1:(s=0,c=n,w())}s<2&&(a+=1,n=requestAnimationFrame(l))};return n=requestAnimationFrame(l),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i)}},[p,o,w,d]),p?f(u(h,{portal:!0,"data-komc":!0,placement:g,className:n(t,o?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[l(`span`,{children:r}),l(_,{placement:g,offset:S})]}),document.body):null}var b=r(({children:e,content:r,defaultOpen:i=!1,className:a,placement:o=`top`})=>{let[d,f]=c(i),m=s(null),g=s(null);return t({ref:m,setOpen:f}),u(`div`,{ref:m,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[l(p,{setOpen:f,children:e}),l(y,{placement:o,className:a,open:d,content:r,hiddenRef:g,containerRef:m}),l(h,{ref:g,role:`presentation`,"aria-hidden":`true`,placement:o,className:n(`komc:opacity-0 komc:invisible`,a),children:l(`span`,{children:r})})]})});export{b as Tooltip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./file-5mweNdAM.cjs`),n=require(`./api-client-
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./file-5mweNdAM.cjs`),n=require(`./api-client-BH5tW3p8.cjs`);let r=require(`react`);const i=[12,120,240,300,406,512,612,768,960,1024,1280,1440,1560,1920,2560,3840];function a({ref:e,src:a,forceLoad:o=!1,folder:s=`media`,fallbackSrc:c,origin:l,originalWidth:u,loading:d=`lazy`,...f}){let p=n.n(),[m,h]=(0,r.useState)(0),[g,_]=(0,r.useState)(o||!a),[v,y]=(0,r.useState)(!a),b=(0,r.useRef)(null),x=(0,r.useRef)(null),S=(0,r.useCallback)(t=>{b.current=t,typeof e==`function`?e(t):e&&(e.current=t)},[e]),C=(0,r.useCallback)((e,t)=>{let n=e.startsWith(`/`)?e.slice(1):e;return t===`static`?p.cdnStatic(n):p.cdnMedia(n)},[p]),w=(0,r.useMemo)(()=>i.filter(e=>e<=u),[u]),T=(0,r.useMemo)(()=>t.i(a)?a:C(a,s),[C,a,s]),E=(0,r.useMemo)(()=>{if(l||!t.a(a)||w.length===0)return;let{filenameWithoutExtension:e,directory:n}=t.o(a,s);if(f.width){let t=w.find(e=>e>=f.width)??w[w.length-1],r=t*2,i=w.find(e=>e>=r)??w[w.length-1];return`${C(`${n}/subsets/w${t}/${e}.webp`,s)} 1x,${C(`${n}/subsets/w${i}/${e}.webp`,s)} 2x`}let r=``;for(let t of w)r+=`${C(`${n}/subsets/w${t}/${e}.webp`,s)} ${t}w, `;return r.trim()},[w,C,s,l,a,f.width]),D=(0,r.useCallback)((e,n)=>{let{filenameWithoutExtension:r,directory:i}=t.o(e,n);return`${C(`${i}/subsets/origin/${r}.webp`,n)}`},[C]),O=(0,r.useMemo)(()=>{if(a)return`${D(a,s)} 1x`},[a,s,D]),k=(0,r.useCallback)(e=>{h(t=>t>=2?(e&&(x.current=e),3):t+1)},[]),A=()=>{if(m===0)return E;if(m===1)return O},j=m>=3?c:T,M=m===0?f.sizes:void 0,N=m>0?`eager`:d;(0,r.useEffect)(()=>{m<3||y(!0)},[m]),(0,r.useEffect)(()=>{let e=b.current;if(!e||v)return;if(e.complete&&e.naturalWidth===0&&e.getAttribute(`src`)){k();return}if(e.complete&&e.naturalWidth>0){_(!0);return}let t=()=>{e.naturalWidth>0&&_(!0)};return e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[v,m,k]);let{fill:P,...F}=f;return{ref:S,isLoad:g,isError:v,imageProps:{...F,src:j,srcSet:A(),sizes:M,loading:N,onError:v?void 0:k}}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,o as n}from"./file-
|
|
1
|
+
import{a as e,i as t,o as n}from"./file-CjW1pMb_.mjs";import{n as r}from"./api-client-B-kwZogn.mjs";import{useCallback as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";const l=[12,120,240,300,406,512,612,768,960,1024,1280,1440,1560,1920,2560,3840];function u({ref:u,src:d,forceLoad:f=!1,folder:p=`media`,fallbackSrc:m,origin:h,originalWidth:g,loading:_=`lazy`,...v}){let y=r(),[b,x]=c(0),[S,C]=c(f||!d),[w,T]=c(!d),E=s(null),D=s(null),O=i(e=>{E.current=e,typeof u==`function`?u(e):u&&(u.current=e)},[u]),k=i((e,t)=>{let n=e.startsWith(`/`)?e.slice(1):e;return t===`static`?y.cdnStatic(n):y.cdnMedia(n)},[y]),A=o(()=>l.filter(e=>e<=g),[g]),j=o(()=>t(d)?d:k(d,p),[k,d,p]),M=o(()=>{if(h||!e(d)||A.length===0)return;let{filenameWithoutExtension:t,directory:r}=n(d,p);if(v.width){let e=A.find(e=>e>=v.width)??A[A.length-1],n=e*2,i=A.find(e=>e>=n)??A[A.length-1];return`${k(`${r}/subsets/w${e}/${t}.webp`,p)} 1x,${k(`${r}/subsets/w${i}/${t}.webp`,p)} 2x`}let i=``;for(let e of A)i+=`${k(`${r}/subsets/w${e}/${t}.webp`,p)} ${e}w, `;return i.trim()},[A,k,p,h,d,v.width]),N=i((e,t)=>{let{filenameWithoutExtension:r,directory:i}=n(e,t);return`${k(`${i}/subsets/origin/${r}.webp`,t)}`},[k]),P=o(()=>{if(d)return`${N(d,p)} 1x`},[d,p,N]),F=i(e=>{x(t=>t>=2?(e&&(D.current=e),3):t+1)},[]),I=()=>{if(b===0)return M;if(b===1)return P},L=b>=3?m:j,R=b===0?v.sizes:void 0,z=b>0?`eager`:_;a(()=>{b<3||T(!0)},[b]),a(()=>{let e=E.current;if(!e||w)return;if(e.complete&&e.naturalWidth===0&&e.getAttribute(`src`)){F();return}if(e.complete&&e.naturalWidth>0){C(!0);return}let t=()=>{e.naturalWidth>0&&C(!0)};return e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[w,b,F]);let{fill:B,...V}=v;return{ref:O,isLoad:S,isError:w,imageProps:{...V,src:L,srcSet:I(),sizes:R,loading:z,onError:w?void 0:F}}}export{u as n,l as t};
|
package/dist/util/common.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,S as t,_ as n,a as r,b as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b,x,y as S}from"../common-
|
|
1
|
+
import{C as e,S as t,_ as n,a as r,b as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b,x,y as S}from"../common-CCtD91nO.mjs";export{v as calcPageCount,p as cn,g as comparePriorityAsc,u as composeKey,r as existLeastOne,m as getFirstLocationAddress,_ as getFullAddress,a as getI18nKey,d as getI18nValue,y as getI18nValues,o as getImageInfo,s as getModelName,h as link,f as loadExLib,l as parseQuery,c as productSlugify,n as selectItemByWeight,b as shuffle,S as sleep,i as slugify,x as sortI18nByPriority,t as withoutProperties,e as withoutProperty};
|
package/dist/util/file.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"../file-
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"../file-CjW1pMb_.mjs";export{a as formatBytes,n as getFileExtension,i as getFilename,t as isExternalSrc,e as isSrcSetCompatible,r as parsePath};
|
package/dist/util/format.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=
|
|
1
|
+
const e=(e,t=`en-US`,n)=>new Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:1,...n}).format(e),t=(e,t,n=`+`)=>e>t?`${t}${n}`:String(e),n=e=>e?.toLocaleString(`ko-KR`)||`0`;exports.formatCompactNumber=e,exports.formatExceedNumber=t,exports.formatKoNumber=n;
|
package/dist/util/format.d.cts
CHANGED
|
@@ -2,33 +2,5 @@
|
|
|
2
2
|
declare const formatCompactNumber: (number: number, locale?: string, options?: Intl.NumberFormatOptions) => string;
|
|
3
3
|
declare const formatExceedNumber: (number: number, threshold: number, suffix?: string) => string;
|
|
4
4
|
declare const formatKoNumber: (number?: number | string | null) => string;
|
|
5
|
-
interface ComputeAspectRatioParams {
|
|
6
|
-
min: {
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
};
|
|
10
|
-
max: {
|
|
11
|
-
width: number;
|
|
12
|
-
height: number;
|
|
13
|
-
};
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
type: 'width' | 'height';
|
|
17
|
-
currentRatio?: number;
|
|
18
|
-
}
|
|
19
|
-
type ComputeAspectRatioWarning = 'width-under-min' | 'width-over-max' | 'height-under-min';
|
|
20
|
-
interface ComputeAspectRatioResult {
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
result: ComputeAspectRatioWarning | null;
|
|
24
|
-
}
|
|
25
|
-
declare const computeAspectRatio: ({
|
|
26
|
-
min,
|
|
27
|
-
max,
|
|
28
|
-
width,
|
|
29
|
-
height,
|
|
30
|
-
type,
|
|
31
|
-
currentRatio
|
|
32
|
-
}: ComputeAspectRatioParams) => ComputeAspectRatioResult;
|
|
33
5
|
//#endregion
|
|
34
|
-
export {
|
|
6
|
+
export { formatCompactNumber, formatExceedNumber, formatKoNumber };
|
package/dist/util/format.d.mts
CHANGED
|
@@ -2,33 +2,5 @@
|
|
|
2
2
|
declare const formatCompactNumber: (number: number, locale?: string, options?: Intl.NumberFormatOptions) => string;
|
|
3
3
|
declare const formatExceedNumber: (number: number, threshold: number, suffix?: string) => string;
|
|
4
4
|
declare const formatKoNumber: (number?: number | string | null) => string;
|
|
5
|
-
interface ComputeAspectRatioParams {
|
|
6
|
-
min: {
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
};
|
|
10
|
-
max: {
|
|
11
|
-
width: number;
|
|
12
|
-
height: number;
|
|
13
|
-
};
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
type: 'width' | 'height';
|
|
17
|
-
currentRatio?: number;
|
|
18
|
-
}
|
|
19
|
-
type ComputeAspectRatioWarning = 'width-under-min' | 'width-over-max' | 'height-under-min';
|
|
20
|
-
interface ComputeAspectRatioResult {
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
result: ComputeAspectRatioWarning | null;
|
|
24
|
-
}
|
|
25
|
-
declare const computeAspectRatio: ({
|
|
26
|
-
min,
|
|
27
|
-
max,
|
|
28
|
-
width,
|
|
29
|
-
height,
|
|
30
|
-
type,
|
|
31
|
-
currentRatio
|
|
32
|
-
}: ComputeAspectRatioParams) => ComputeAspectRatioResult;
|
|
33
5
|
//#endregion
|
|
34
|
-
export {
|
|
6
|
+
export { formatCompactNumber, formatExceedNumber, formatKoNumber };
|
package/dist/util/format.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=(e,t=`en-US`,n)=>new Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:1,...n}).format(e),t=(e,t,n=`+`)=>e>t?`${t}${n}`:String(e),n=e=>e?.toLocaleString(`ko-KR`)||`0`;export{e as formatCompactNumber,t as formatExceedNumber,n as formatKoNumber};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@machinerd/js-module",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"sideEffects": [
|
|
11
11
|
"**/*.css",
|
|
12
|
-
"./dist/styles/index.css"
|
|
13
|
-
"./dist/styles/editor.css"
|
|
12
|
+
"./dist/styles/index.css"
|
|
14
13
|
],
|
|
15
14
|
"exports": {
|
|
16
15
|
".": {
|
|
@@ -49,14 +48,6 @@
|
|
|
49
48
|
"import": "./dist/util/phone.mjs",
|
|
50
49
|
"require": "./dist/util/phone.cjs"
|
|
51
50
|
},
|
|
52
|
-
"./util/editor": {
|
|
53
|
-
"import": "./dist/util/editor.mjs",
|
|
54
|
-
"require": "./dist/util/editor.cjs"
|
|
55
|
-
},
|
|
56
|
-
"./editor": {
|
|
57
|
-
"import": "./dist/editor/index.mjs",
|
|
58
|
-
"require": "./dist/editor/index.cjs"
|
|
59
|
-
},
|
|
60
51
|
"./ui/common": {
|
|
61
52
|
"import": "./dist/ui/index.mjs",
|
|
62
53
|
"require": "./dist/ui/index.cjs"
|
|
@@ -77,14 +68,6 @@
|
|
|
77
68
|
"import": "./dist/ui/dnd/index.mjs",
|
|
78
69
|
"require": "./dist/ui/dnd/index.cjs"
|
|
79
70
|
},
|
|
80
|
-
"./ui/dropdown": {
|
|
81
|
-
"import": "./dist/ui/dropdown/index.mjs",
|
|
82
|
-
"require": "./dist/ui/dropdown/index.cjs"
|
|
83
|
-
},
|
|
84
|
-
"./ui/preserve-focus-button": {
|
|
85
|
-
"import": "./dist/ui/preserve-focus-button/index.mjs",
|
|
86
|
-
"require": "./dist/ui/preserve-focus-button/index.cjs"
|
|
87
|
-
},
|
|
88
71
|
"./ui/image": {
|
|
89
72
|
"import": "./dist/ui/image/index.mjs",
|
|
90
73
|
"require": "./dist/ui/image/index.cjs"
|
|
@@ -117,8 +100,7 @@
|
|
|
117
100
|
"import": "./dist/providers/noti-stack/index.mjs",
|
|
118
101
|
"require": "./dist/providers/noti-stack/index.cjs"
|
|
119
102
|
},
|
|
120
|
-
"./styles/index.css": "./dist/styles/index.css"
|
|
121
|
-
"./styles/editor.css": "./dist/styles/editor.css"
|
|
103
|
+
"./styles/index.css": "./dist/styles/index.css"
|
|
122
104
|
},
|
|
123
105
|
"keywords": [],
|
|
124
106
|
"author": "KOMACHINE",
|
|
@@ -129,13 +111,9 @@
|
|
|
129
111
|
"@dnd-kit/sortable": "^10.0.0",
|
|
130
112
|
"@dnd-kit/utilities": "^3.2.2",
|
|
131
113
|
"@eslint/js": "^9.39.5",
|
|
132
|
-
"@floating-ui/react": "^0.27.16",
|
|
133
114
|
"@storybook/addon-docs": "^10.3.5",
|
|
134
115
|
"@storybook/react-vite": "^10.5.10",
|
|
135
116
|
"@tailwindcss/postcss": "^4.1.18",
|
|
136
|
-
"@tiptap/core": "^3.2.0",
|
|
137
|
-
"@tiptap/pm": "^3.2.0",
|
|
138
|
-
"@tiptap/react": "^3.2.0",
|
|
139
117
|
"@types/google-libphonenumber": "^7.4.30",
|
|
140
118
|
"@types/js-cookie": "^3.0.6",
|
|
141
119
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -180,10 +158,6 @@
|
|
|
180
158
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
181
159
|
"@dnd-kit/sortable": "^10.0.0",
|
|
182
160
|
"@dnd-kit/utilities": "^3.0.0",
|
|
183
|
-
"@floating-ui/react": "^0.27.0",
|
|
184
|
-
"@tiptap/core": "^3.2.0",
|
|
185
|
-
"@tiptap/pm": "^3.2.0",
|
|
186
|
-
"@tiptap/react": "^3.2.0",
|
|
187
161
|
"embla-carousel": "^8.0.0",
|
|
188
162
|
"embla-carousel-react": "^8.0.0",
|
|
189
163
|
"notistack": "^3.0.0",
|
|
@@ -204,9 +178,6 @@
|
|
|
204
178
|
"@dnd-kit/utilities": {
|
|
205
179
|
"optional": true
|
|
206
180
|
},
|
|
207
|
-
"@floating-ui/react": {
|
|
208
|
-
"optional": true
|
|
209
|
-
},
|
|
210
181
|
"embla-carousel": {
|
|
211
182
|
"optional": true
|
|
212
183
|
},
|
|
@@ -218,15 +189,6 @@
|
|
|
218
189
|
},
|
|
219
190
|
"motion": {
|
|
220
191
|
"optional": true
|
|
221
|
-
},
|
|
222
|
-
"@tiptap/core": {
|
|
223
|
-
"optional": true
|
|
224
|
-
},
|
|
225
|
-
"@tiptap/pm": {
|
|
226
|
-
"optional": true
|
|
227
|
-
},
|
|
228
|
-
"@tiptap/react": {
|
|
229
|
-
"optional": true
|
|
230
192
|
}
|
|
231
193
|
},
|
|
232
194
|
"scripts": {
|
|
@@ -234,7 +196,7 @@
|
|
|
234
196
|
"build": "tsdown && pnpm build:css",
|
|
235
197
|
"build:pack": "pnpm build && pnpm pack",
|
|
236
198
|
"build:tsc": "pnpm tsc",
|
|
237
|
-
"build:css": "pnpm dlx @tailwindcss/cli -i src/styles/index.css -o dist/styles/index.css
|
|
199
|
+
"build:css": "pnpm dlx @tailwindcss/cli -i src/styles/index.css -o dist/styles/index.css",
|
|
238
200
|
"storybook": "storybook dev -p 6006",
|
|
239
201
|
"build-storybook": "storybook build",
|
|
240
202
|
"lint": "eslint --cache --fix"
|