@machinerd/js-module 0.0.10 → 0.1.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 +30 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.d.cts +18 -0
- package/dist/hooks/index.d.mts +18 -0
- package/dist/hooks/index.mjs +1 -0
- package/dist/hooks-5I2NBtcY.mjs +1 -0
- package/dist/hooks-DPYIex_y.cjs +1 -0
- package/dist/styles/index.css +761 -0
- package/dist/ui/index.cjs +1 -0
- package/dist/ui/index.d.cts +291 -0
- package/dist/ui/index.d.mts +291 -0
- package/dist/ui/index.mjs +1 -0
- package/dist/util/index.cjs +1 -1
- package/dist/util/index.d.cts +48 -26
- package/dist/util/index.d.mts +48 -26
- package/dist/util/index.mjs +1 -1
- package/dist/util-CDkao6z3.cjs +1 -0
- package/dist/util-DCPr_-5a.mjs +1 -0
- package/package.json +35 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../util-CDkao6z3.cjs`),n=require(`../hooks-DPYIex_y.cjs`);let r=require(`lodash-es`),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(`react-dom`);function l({className:e,items:t,render:n,...r}){return(0,o.jsx)(`nav`,{className:(0,i.default)(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0 komc:box-border`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...r,children:(0,o.jsx)(`div`,{className:`komc:grid komc:min-h-15 komc:p-0`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>(0,o.jsx)(a.default.Fragment,{children:n(e)},t))})})}const u=(0,s.cva)(t.f(`komc:inline-flex komc:justify-center komc:items-center komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:*:transition-colors komc:*:duration-200 komc:cursor-pointer`,`komc:disabled:cursor-default komc:disabled:opacity-50 komc:disabled:pointer-events-none`,`komc:whitespace-nowrap komc:shrink-0 komc:outline-none komc:box-border`),{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`,"2.5xl":`komc:rounded-[20px]`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`},variant:{default:``,ghost:`komc:bg-transparent komc:text-neutral-900`,white:`komc:bg-white komc:text-neutral-900 komc:hover:bg-neutral-100`,blue:`komc:bg-blue-500 komc:text-white komc:hover:bg-blue-600`,night:`komc:bg-[#2c5cb7] komc:text-white komc:hover:bg-[#26539F]`,charcoal:`komc:bg-[#36454F] komc:text-white komc:hover:bg-[#2E3A43]`,slate:`komc:bg-[#4A5565] komc:text-white komc:hover:bg-[#424A57]`,red:`komc:bg-[#C8313A] komc:text-white komc:hover:bg-[#B02B33]`,yellow:`komc:bg-[#E7FF14] komc:text-black komc:hover:bg-[#D4E600]`,black:`komc:bg-[rgb(95,95,96)] komc:text-white komc:hover:bg-[rgb(76,76,77)] komc:active:bg-[rgb(76,76,77)]`}},defaultVariants:{size:void 0,outline:void 0,rounded:void 0,variant:void 0}}),d=(0,a.forwardRef)(({children:e=`button`,type:t=`button`,size:n=`md`,gap:r=`sm`,outline:i=`line`,rounded:a=`sm`,variant:s=`blue`,className:c,...l},d)=>(0,o.jsx)(`button`,{ref:d,type:t,className:u({size:n,outline:i,gap:r,rounded:a,variant:s,className:c}),...l,children:e}));var f=d;function p({condition:e,wrapper:t,children:n}){return e?t(n):n}const m=(0,s.cva)(t.f(`komc:flex komc:items-center komc:w-full komc:px-2 komc:box-border`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:border-none komc:[&>input]:h-full`,`komc:[&>input]:p-0 komc:[&>input]:m-0`),{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`}}}),h=(0,a.forwardRef)(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:a=`lg`,className:s,...c},l)=>(0,o.jsxs)(`div`,{className:m({size:n,gap:r,outline:i,rounded:a,className:s}),children:[e,(0,o.jsx)(`input`,{ref:l,type:`text`,...c}),t]}));var g=h;const _=(0,s.cva)(t.f(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},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`}},defaultVariants:{size:`sm`,rounded:`sm`}});function v({size:e,rounded:t,width:n,height:r,className:i,...a}){let s=n?typeof n==`string`?n:`${n}px`:void 0,c=r?typeof r==`string`?r:`${r}px`:void 0;return(0,o.jsx)(`div`,{className:_({size:e,rounded:t,className:i}),style:{width:s,height:c},...a})}function y({children:e,setOpen:t}){return(0,o.jsx)(`div`,{className:(0,i.default)(`komc:inline-flex komc:shrink-0 komc:justify-center komc:items-center`,`komc:bg-transparent komc:border-none komc:outline-none`,`komc:p-0 komc:m-0 komc:box-border`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const b=(0,s.cva)(t.f(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2`,`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)]`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,left:``,right:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``,"left-start":``,"left-end":``,"right-start":``,"right-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`left`,className:`komc:-translate-x-2`},{portal:!0,placement:`right`,className:`komc:translate-x-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:!0,placement:`left-start`,className:`komc:-translate-x-2`},{portal:!0,placement:`left-end`,className:`komc:-translate-x-2`},{portal:!0,placement:`right-start`,className:`komc:translate-x-2`},{portal:!0,placement:`right-end`,className:`komc:translate-x-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:`left`,className:`komc:right-full komc:top-1/2 komc:-translate-y-1/2`},{portal:!1,placement:`right`,className:`komc:left-full komc:top-1/2 komc:-translate-y-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`},{portal:!1,placement:`left-start`,className:`komc:right-full komc:top-0`},{portal:!1,placement:`left-end`,className:`komc:right-full komc:bottom-0`},{portal:!1,placement:`right-start`,className:`komc:left-full komc:top-0`},{portal:!1,placement:`right-end`,className:`komc:left-full komc:bottom-0`}],defaultVariants:{placement:`top`,portal:!1}}),x=(0,a.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},a)=>(0,o.jsx)(`div`,{ref:a,role:`tooltip`,className:b({portal:e,placement:r,className:n}),...i,children:t}));var S=x;const C=(0,s.cva)(t.f(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.f(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.f(`komc:bottom-full komc:-mb-1 komc:left-1/2`),left:t.f(`komc:left-full komc:-ml-1 komc:top-1/2`),right:t.f(`komc:right-full komc:-mr-1 komc:top-1/2`),"top-start":t.f(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.f(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.f(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.f(`komc:bottom-full komc:-mb-1 komc:right-5`),"left-start":t.f(`komc:left-full komc:-ml-1 komc:top-3`),"left-end":t.f(`komc:left-full komc:-ml-1 komc:bottom-3`),"right-start":t.f(`komc:right-full komc:-mr-1 komc:top-3`),"right-end":t.f(`komc:right-full komc:-mr-1 komc:bottom-3`)}},defaultVariants:{placement:`top`}}),w=({placement:e,className:t,offset:n,style:r,...i})=>{let s=(0,a.useMemo)(()=>{switch(e){case`top`:return`rotate(45deg)`;case`bottom`:return`rotate(225deg)`;case`left`:return`rotate(-45deg)`;case`right`:return`rotate(135deg)`;case`top-start`:return`rotate(45deg)`;case`top-end`:return`rotate(45deg)`;case`bottom-start`:return`rotate(225deg)`;case`bottom-end`:return`rotate(225deg)`;case`left-start`:return`rotate(-45deg)`;case`left-end`:return`rotate(-45deg)`;case`right-start`:return`rotate(135deg)`;case`right-end`:return`rotate(135deg)`;default:return`rotate(45deg)`}},[e]);return(0,o.jsx)(`div`,{className:C({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${s}`},...i})};var T=w;const E=24,D=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function O({placement:e,className:t,content:n,open:s,hiddenRef:l,containerRef:u}){let[d,f]=(0,a.useState)(!1),p=(0,a.useRef)(null),[m,h]=(0,a.useState)(e),[g,_]=(0,a.useState)({top:0,left:0}),[v,y]=(0,a.useState)({x:0,y:0}),b=(0,a.useCallback)((0,r.debounce)(()=>{let e=u?.current,t=l.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.scrollY||document.documentElement.scrollTop,a=window.scrollX||document.documentElement.scrollLeft,[o,s]=m.split(`-`),c=i+n.top,d=a+n.left+n.width/2-r.width/2;switch(o){case`top`:c-=r.height;break;case`bottom`:c+=n.height;break;case`left`:c+=n.height/2-r.height/2,d-=r.width/2+n.width/2;break;case`right`:c+=n.height/2-r.height/2,d+=r.width/2+n.width/2;break}if([`top`,`bottom`].includes(o))switch(s){case`start`:d+=r.width/2-24;break;case`end`:d-=r.width/2-24;break}if([`left`,`right`].includes(o))switch(s){case`start`:c+=r.height/2+n.height/2-24;break;case`end`:c-=r.height/2+n.height/2-24;break}let f=d,p=window.innerWidth;f+r.width>p-4&&(f=p-r.width-4),f<4&&(f=4),_({top:c,left:f}),y({x:d-f,y:0})},50),[m]),x=(0,a.useCallback)((0,r.debounce)(()=>{if(!l.current)return;let{top:t,height:n}=l.current.getBoundingClientRect();h(r=>{let i=e;return t+n>=window.innerHeight?i=D(r,`top`):t<0&&(i=D(r,`bottom`)),i})},50),[e]);return(0,a.useEffect)(()=>(f(!0),x(),window.addEventListener(`scroll`,b,{passive:!0}),window.addEventListener(`resize`,b),window.addEventListener(`scroll`,x,{passive:!0}),window.addEventListener(`resize`,x),()=>{window.removeEventListener(`scroll`,b),window.removeEventListener(`resize`,b),window.removeEventListener(`scroll`,x),window.removeEventListener(`resize`,x)}),[b,x]),(0,a.useEffect)(()=>{d&&b()},[d,b]),d?(0,c.createPortal)((0,o.jsxs)(S,{ref:p,portal:!0,placement:m,className:(0,i.default)(t,s?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(T,{placement:m,offset:v})]}),document.body):null}const k=(0,a.forwardRef)(({children:e,content:t,defaultOpen:r=!1,className:s,placement:c=`top`},l)=>{let[u,d]=(0,a.useState)(r),f=(0,a.useRef)(null),p=(0,a.useRef)(null);return n.t({ref:f,setOpen:d}),(0,o.jsxs)(`div`,{ref:f,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,o.jsx)(y,{setOpen:d,children:e}),(0,o.jsx)(O,{placement:c,className:s,open:u,content:t,hiddenRef:p,containerRef:f}),(0,o.jsx)(S,{ref:p,role:`presentation`,placement:c,className:(0,i.default)(`komc:opacity-0 komc:invisible`,s),children:(0,o.jsx)(`span`,{children:t})})]})});var A=k;exports.BottomAppBar=l,exports.Button=f,exports.ConditionalWrapper=p,exports.Input=g,exports.Skeleton=v,exports.Tooltip=A;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import * as react4 from "react";
|
|
2
|
+
import React$1, { HTMLAttributes } from "react";
|
|
3
|
+
import * as class_variance_authority_types1 from "class-variance-authority/types";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
8
|
+
interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
|
|
9
|
+
items: T[];
|
|
10
|
+
render: (item: T) => React$1.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function BottomAppBar<T>({
|
|
13
|
+
className,
|
|
14
|
+
items,
|
|
15
|
+
render,
|
|
16
|
+
...props
|
|
17
|
+
}: BottomAppBarProps<T>): React$1.ReactNode;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/ui/button/button.d.ts
|
|
20
|
+
declare const classes$2: (props?: ({
|
|
21
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
22
|
+
gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
23
|
+
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
24
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "none" | "2.5xl" | null | undefined;
|
|
25
|
+
variant?: "default" | "ghost" | "white" | "blue" | "night" | "charcoal" | "slate" | "red" | "yellow" | "black" | null | undefined;
|
|
26
|
+
} & class_variance_authority_types1.ClassProp) | undefined) => string;
|
|
27
|
+
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'suffix' | 'prefix'>, VariantProps<typeof classes$2> {
|
|
28
|
+
/**
|
|
29
|
+
* @param size - Height of the button
|
|
30
|
+
* @default md - 40px
|
|
31
|
+
* @property
|
|
32
|
+
* - xs: 30px
|
|
33
|
+
* - sm: 32px
|
|
34
|
+
* - base: 36px
|
|
35
|
+
* - md: 40px
|
|
36
|
+
* - lg: 44px
|
|
37
|
+
* - xl: 48px
|
|
38
|
+
* - 2xl: 52px
|
|
39
|
+
* - 3xl: 56px
|
|
40
|
+
*/
|
|
41
|
+
size?: VariantProps<typeof classes$2>['size'];
|
|
42
|
+
/**
|
|
43
|
+
* @param gap - Gap between the button and the content
|
|
44
|
+
* @default sm - 8px
|
|
45
|
+
* @property
|
|
46
|
+
* - none: 0
|
|
47
|
+
* - xs: 4px
|
|
48
|
+
* - sm: 8px
|
|
49
|
+
* - md: 12px
|
|
50
|
+
* - lg: 16px
|
|
51
|
+
* - xl: 20px
|
|
52
|
+
*/
|
|
53
|
+
gap?: VariantProps<typeof classes$2>['gap'];
|
|
54
|
+
/**
|
|
55
|
+
* @param rounded - Border radius of the button
|
|
56
|
+
* @default sm
|
|
57
|
+
* @property
|
|
58
|
+
* - none: 0
|
|
59
|
+
* - sm: 2px
|
|
60
|
+
* - md: 6px
|
|
61
|
+
* - lg: 8px
|
|
62
|
+
* - xl: 12px
|
|
63
|
+
* - 2xl: 16px
|
|
64
|
+
* - 2.5xl: 20px
|
|
65
|
+
* - 3xl: 24px
|
|
66
|
+
* - full: 100%
|
|
67
|
+
*/
|
|
68
|
+
rounded?: VariantProps<typeof classes$2>['rounded'];
|
|
69
|
+
/**
|
|
70
|
+
* @param variant - Variant of the button
|
|
71
|
+
* @default blue
|
|
72
|
+
* @property
|
|
73
|
+
* - default
|
|
74
|
+
* - ghost
|
|
75
|
+
* - white
|
|
76
|
+
* - blue
|
|
77
|
+
* - night
|
|
78
|
+
* - charcoal
|
|
79
|
+
* - slate
|
|
80
|
+
* - red
|
|
81
|
+
* - yellow
|
|
82
|
+
* - black
|
|
83
|
+
*/
|
|
84
|
+
variant?: VariantProps<typeof classes$2>['variant'];
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
children?: React.ReactNode;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @param children - Children of the button
|
|
90
|
+
* @param type - Type of the button
|
|
91
|
+
* @param size - Size of the button
|
|
92
|
+
* @param gap - Gap between the button and the content
|
|
93
|
+
* @param outline - Outline of the button
|
|
94
|
+
* @param rounded - Border radius of the button
|
|
95
|
+
* @param variant - Variant of the button
|
|
96
|
+
* @param className - Class name
|
|
97
|
+
*/
|
|
98
|
+
declare const Button: react4.ForwardRefExoticComponent<ButtonProps & react4.RefAttributes<HTMLButtonElement>>;
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
101
|
+
interface ConditionalWrapperProps {
|
|
102
|
+
condition: boolean;
|
|
103
|
+
wrapper: (children: React.ReactNode) => React.ReactNode;
|
|
104
|
+
children: React.ReactNode;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @param condition - Condition to wrap the children
|
|
108
|
+
* @param wrapper - Wrapper function
|
|
109
|
+
* @param children - Children to wrap
|
|
110
|
+
*/
|
|
111
|
+
declare function ConditionalWrapper({
|
|
112
|
+
condition,
|
|
113
|
+
wrapper,
|
|
114
|
+
children
|
|
115
|
+
}: ConditionalWrapperProps): react4.ReactNode;
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/ui/input/input.d.ts
|
|
118
|
+
declare const classes$1: (props?: ({
|
|
119
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
120
|
+
gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
121
|
+
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
122
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | null | undefined;
|
|
123
|
+
} & class_variance_authority_types1.ClassProp) | undefined) => string;
|
|
124
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
|
|
125
|
+
/**
|
|
126
|
+
* @param size - Height of the input
|
|
127
|
+
* @default lg - 44px
|
|
128
|
+
* @property
|
|
129
|
+
* - xs: 30px
|
|
130
|
+
* - sm: 32px
|
|
131
|
+
* - base: 36px
|
|
132
|
+
* - md: 40px
|
|
133
|
+
* - lg: 44px
|
|
134
|
+
* - xl: 48px
|
|
135
|
+
* - 2xl: 52px
|
|
136
|
+
* - 3xl: 56px
|
|
137
|
+
*/
|
|
138
|
+
size?: VariantProps<typeof classes$1>['size'];
|
|
139
|
+
/**
|
|
140
|
+
* @param gap - Gap between the input and the prefix/suffix
|
|
141
|
+
* @default xl - 20px
|
|
142
|
+
* @property
|
|
143
|
+
* - none: 0
|
|
144
|
+
* - xs: 4px
|
|
145
|
+
* - sm: 8px
|
|
146
|
+
* - md: 12px
|
|
147
|
+
* - lg: 16px
|
|
148
|
+
* - xl: 20px
|
|
149
|
+
*/
|
|
150
|
+
gap?: VariantProps<typeof classes$1>['gap'];
|
|
151
|
+
outline?: VariantProps<typeof classes$1>['outline'];
|
|
152
|
+
/**
|
|
153
|
+
* @param rounded - Border radius of the input
|
|
154
|
+
* @default lg
|
|
155
|
+
* @property
|
|
156
|
+
* - none: 0
|
|
157
|
+
* - sm: 2px
|
|
158
|
+
* - md: 6px
|
|
159
|
+
* - lg: 8px
|
|
160
|
+
* - xl: 12px
|
|
161
|
+
* - 2xl: 16px
|
|
162
|
+
*/
|
|
163
|
+
rounded?: VariantProps<typeof classes$1>['rounded'];
|
|
164
|
+
prefix?: React.ReactNode;
|
|
165
|
+
surffix?: React.ReactNode;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* @param prefix - Prefix of the input
|
|
169
|
+
* @param surffix - Surffix of the input
|
|
170
|
+
* @param size - Size of the input
|
|
171
|
+
* @param gap - Gap between the input and the prefix/suffix
|
|
172
|
+
* @param outline - Outline of the input
|
|
173
|
+
* @param rounded - Border radius of the input
|
|
174
|
+
* @param className - Class name
|
|
175
|
+
*/
|
|
176
|
+
declare const Input: react4.ForwardRefExoticComponent<InputProps & react4.RefAttributes<HTMLInputElement>>;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/ui/skeleton/skeleton.d.ts
|
|
179
|
+
declare const classes: (props?: ({
|
|
180
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "square" | "full" | null | undefined;
|
|
181
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "none" | null | undefined;
|
|
182
|
+
} & class_variance_authority_types1.ClassProp) | undefined) => string;
|
|
183
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
184
|
+
/**
|
|
185
|
+
* @param width - Width of the skeleton
|
|
186
|
+
* @description string or number, number unit is px
|
|
187
|
+
* @default 100
|
|
188
|
+
*/
|
|
189
|
+
width?: string | number;
|
|
190
|
+
/**
|
|
191
|
+
* @param height - Height of the skeleton
|
|
192
|
+
* @description string or number, number unit is px
|
|
193
|
+
* @default 100
|
|
194
|
+
*/
|
|
195
|
+
height?: string | number;
|
|
196
|
+
/**
|
|
197
|
+
* @param size - Size of the skeleton (height)
|
|
198
|
+
* @default sm
|
|
199
|
+
* @property
|
|
200
|
+
* - xs: 4px
|
|
201
|
+
* - sm: 8px
|
|
202
|
+
* - md: 12px
|
|
203
|
+
* - lg: 16px
|
|
204
|
+
* - xl: 20px
|
|
205
|
+
* - 2xl: 24px
|
|
206
|
+
* - 3xl: 28px
|
|
207
|
+
* - square: 100%
|
|
208
|
+
* - full: 100%
|
|
209
|
+
*/
|
|
210
|
+
size?: VariantProps<typeof classes>['size'];
|
|
211
|
+
/**
|
|
212
|
+
* @param rounded - Rounded of the skeleton
|
|
213
|
+
* @default sm
|
|
214
|
+
* @property
|
|
215
|
+
* - none: 0
|
|
216
|
+
* - sm: 2px
|
|
217
|
+
* - md: 6px
|
|
218
|
+
* - lg: 8px
|
|
219
|
+
* - xl: 12px
|
|
220
|
+
* - 2xl: 16px
|
|
221
|
+
* - 3xl: 20px
|
|
222
|
+
* - full: 100%
|
|
223
|
+
*/
|
|
224
|
+
rounded?: VariantProps<typeof classes>['rounded'];
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @param size - Size of the skeleton (height)
|
|
228
|
+
* @param rounded - Rounded of the skeleton
|
|
229
|
+
* @param width - Width of the skeleton
|
|
230
|
+
* @param height - Height of the skeleton
|
|
231
|
+
* @param className - Class name
|
|
232
|
+
*/
|
|
233
|
+
declare function Skeleton({
|
|
234
|
+
size,
|
|
235
|
+
rounded,
|
|
236
|
+
width,
|
|
237
|
+
height,
|
|
238
|
+
className,
|
|
239
|
+
...props
|
|
240
|
+
}: SkeletonProps): react_jsx_runtime0.JSX.Element;
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/ui/tooltip/tooltip-container.d.ts
|
|
243
|
+
type SubPlacement = 'start' | 'end';
|
|
244
|
+
type MainPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
245
|
+
type TooltipPlacement = MainPlacement | `${MainPlacement}-${SubPlacement}`;
|
|
246
|
+
interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
247
|
+
/**
|
|
248
|
+
* @param children - Trigger element
|
|
249
|
+
*/
|
|
250
|
+
children: React.ReactNode;
|
|
251
|
+
/**
|
|
252
|
+
* @param content - Tooltip content
|
|
253
|
+
*/
|
|
254
|
+
content: string;
|
|
255
|
+
/**
|
|
256
|
+
* @param placement - Placement of the tooltip
|
|
257
|
+
* @default top
|
|
258
|
+
* @property
|
|
259
|
+
* - top
|
|
260
|
+
* - bottom
|
|
261
|
+
* - left
|
|
262
|
+
* - right
|
|
263
|
+
* - top-start
|
|
264
|
+
* - top-end
|
|
265
|
+
* - bottom-start
|
|
266
|
+
* - bottom-end
|
|
267
|
+
* - left-start
|
|
268
|
+
* - left-end
|
|
269
|
+
* - right-start
|
|
270
|
+
* - right-end
|
|
271
|
+
*/
|
|
272
|
+
placement?: TooltipPlacement;
|
|
273
|
+
/**
|
|
274
|
+
* @param defaultOpen - Default open state of the tooltip
|
|
275
|
+
* @default false
|
|
276
|
+
* @property
|
|
277
|
+
* - true: Open the tooltip
|
|
278
|
+
* - false: Close the tooltip
|
|
279
|
+
*/
|
|
280
|
+
defaultOpen?: boolean;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* @param children - Trigger element
|
|
284
|
+
* @param content - Tooltip content
|
|
285
|
+
* @param defaultOpen - Default open state of the tooltip
|
|
286
|
+
* @param className - Class name
|
|
287
|
+
* @param placement - Placement of the tooltip
|
|
288
|
+
*/
|
|
289
|
+
declare const TooltipContainer: react4.ForwardRefExoticComponent<TooltipContainerProps & react4.RefAttributes<HTMLDivElement>>;
|
|
290
|
+
//#endregion
|
|
291
|
+
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import * as react2 from "react";
|
|
2
|
+
import React$1, { HTMLAttributes } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
+
|
|
7
|
+
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
8
|
+
interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
|
|
9
|
+
items: T[];
|
|
10
|
+
render: (item: T) => React$1.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function BottomAppBar<T>({
|
|
13
|
+
className,
|
|
14
|
+
items,
|
|
15
|
+
render,
|
|
16
|
+
...props
|
|
17
|
+
}: BottomAppBarProps<T>): React$1.ReactNode;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/ui/button/button.d.ts
|
|
20
|
+
declare const classes$2: (props?: ({
|
|
21
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
22
|
+
gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
23
|
+
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
24
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "none" | "2.5xl" | null | undefined;
|
|
25
|
+
variant?: "default" | "ghost" | "white" | "blue" | "night" | "charcoal" | "slate" | "red" | "yellow" | "black" | null | undefined;
|
|
26
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
27
|
+
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'suffix' | 'prefix'>, VariantProps<typeof classes$2> {
|
|
28
|
+
/**
|
|
29
|
+
* @param size - Height of the button
|
|
30
|
+
* @default md - 40px
|
|
31
|
+
* @property
|
|
32
|
+
* - xs: 30px
|
|
33
|
+
* - sm: 32px
|
|
34
|
+
* - base: 36px
|
|
35
|
+
* - md: 40px
|
|
36
|
+
* - lg: 44px
|
|
37
|
+
* - xl: 48px
|
|
38
|
+
* - 2xl: 52px
|
|
39
|
+
* - 3xl: 56px
|
|
40
|
+
*/
|
|
41
|
+
size?: VariantProps<typeof classes$2>['size'];
|
|
42
|
+
/**
|
|
43
|
+
* @param gap - Gap between the button and the content
|
|
44
|
+
* @default sm - 8px
|
|
45
|
+
* @property
|
|
46
|
+
* - none: 0
|
|
47
|
+
* - xs: 4px
|
|
48
|
+
* - sm: 8px
|
|
49
|
+
* - md: 12px
|
|
50
|
+
* - lg: 16px
|
|
51
|
+
* - xl: 20px
|
|
52
|
+
*/
|
|
53
|
+
gap?: VariantProps<typeof classes$2>['gap'];
|
|
54
|
+
/**
|
|
55
|
+
* @param rounded - Border radius of the button
|
|
56
|
+
* @default sm
|
|
57
|
+
* @property
|
|
58
|
+
* - none: 0
|
|
59
|
+
* - sm: 2px
|
|
60
|
+
* - md: 6px
|
|
61
|
+
* - lg: 8px
|
|
62
|
+
* - xl: 12px
|
|
63
|
+
* - 2xl: 16px
|
|
64
|
+
* - 2.5xl: 20px
|
|
65
|
+
* - 3xl: 24px
|
|
66
|
+
* - full: 100%
|
|
67
|
+
*/
|
|
68
|
+
rounded?: VariantProps<typeof classes$2>['rounded'];
|
|
69
|
+
/**
|
|
70
|
+
* @param variant - Variant of the button
|
|
71
|
+
* @default blue
|
|
72
|
+
* @property
|
|
73
|
+
* - default
|
|
74
|
+
* - ghost
|
|
75
|
+
* - white
|
|
76
|
+
* - blue
|
|
77
|
+
* - night
|
|
78
|
+
* - charcoal
|
|
79
|
+
* - slate
|
|
80
|
+
* - red
|
|
81
|
+
* - yellow
|
|
82
|
+
* - black
|
|
83
|
+
*/
|
|
84
|
+
variant?: VariantProps<typeof classes$2>['variant'];
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
children?: React.ReactNode;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @param children - Children of the button
|
|
90
|
+
* @param type - Type of the button
|
|
91
|
+
* @param size - Size of the button
|
|
92
|
+
* @param gap - Gap between the button and the content
|
|
93
|
+
* @param outline - Outline of the button
|
|
94
|
+
* @param rounded - Border radius of the button
|
|
95
|
+
* @param variant - Variant of the button
|
|
96
|
+
* @param className - Class name
|
|
97
|
+
*/
|
|
98
|
+
declare const Button: react2.ForwardRefExoticComponent<ButtonProps & react2.RefAttributes<HTMLButtonElement>>;
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
101
|
+
interface ConditionalWrapperProps {
|
|
102
|
+
condition: boolean;
|
|
103
|
+
wrapper: (children: React.ReactNode) => React.ReactNode;
|
|
104
|
+
children: React.ReactNode;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @param condition - Condition to wrap the children
|
|
108
|
+
* @param wrapper - Wrapper function
|
|
109
|
+
* @param children - Children to wrap
|
|
110
|
+
*/
|
|
111
|
+
declare function ConditionalWrapper({
|
|
112
|
+
condition,
|
|
113
|
+
wrapper,
|
|
114
|
+
children
|
|
115
|
+
}: ConditionalWrapperProps): react2.ReactNode;
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/ui/input/input.d.ts
|
|
118
|
+
declare const classes$1: (props?: ({
|
|
119
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
120
|
+
gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
121
|
+
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
122
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | null | undefined;
|
|
123
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
124
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
|
|
125
|
+
/**
|
|
126
|
+
* @param size - Height of the input
|
|
127
|
+
* @default lg - 44px
|
|
128
|
+
* @property
|
|
129
|
+
* - xs: 30px
|
|
130
|
+
* - sm: 32px
|
|
131
|
+
* - base: 36px
|
|
132
|
+
* - md: 40px
|
|
133
|
+
* - lg: 44px
|
|
134
|
+
* - xl: 48px
|
|
135
|
+
* - 2xl: 52px
|
|
136
|
+
* - 3xl: 56px
|
|
137
|
+
*/
|
|
138
|
+
size?: VariantProps<typeof classes$1>['size'];
|
|
139
|
+
/**
|
|
140
|
+
* @param gap - Gap between the input and the prefix/suffix
|
|
141
|
+
* @default xl - 20px
|
|
142
|
+
* @property
|
|
143
|
+
* - none: 0
|
|
144
|
+
* - xs: 4px
|
|
145
|
+
* - sm: 8px
|
|
146
|
+
* - md: 12px
|
|
147
|
+
* - lg: 16px
|
|
148
|
+
* - xl: 20px
|
|
149
|
+
*/
|
|
150
|
+
gap?: VariantProps<typeof classes$1>['gap'];
|
|
151
|
+
outline?: VariantProps<typeof classes$1>['outline'];
|
|
152
|
+
/**
|
|
153
|
+
* @param rounded - Border radius of the input
|
|
154
|
+
* @default lg
|
|
155
|
+
* @property
|
|
156
|
+
* - none: 0
|
|
157
|
+
* - sm: 2px
|
|
158
|
+
* - md: 6px
|
|
159
|
+
* - lg: 8px
|
|
160
|
+
* - xl: 12px
|
|
161
|
+
* - 2xl: 16px
|
|
162
|
+
*/
|
|
163
|
+
rounded?: VariantProps<typeof classes$1>['rounded'];
|
|
164
|
+
prefix?: React.ReactNode;
|
|
165
|
+
surffix?: React.ReactNode;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* @param prefix - Prefix of the input
|
|
169
|
+
* @param surffix - Surffix of the input
|
|
170
|
+
* @param size - Size of the input
|
|
171
|
+
* @param gap - Gap between the input and the prefix/suffix
|
|
172
|
+
* @param outline - Outline of the input
|
|
173
|
+
* @param rounded - Border radius of the input
|
|
174
|
+
* @param className - Class name
|
|
175
|
+
*/
|
|
176
|
+
declare const Input: react2.ForwardRefExoticComponent<InputProps & react2.RefAttributes<HTMLInputElement>>;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/ui/skeleton/skeleton.d.ts
|
|
179
|
+
declare const classes: (props?: ({
|
|
180
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "square" | "full" | null | undefined;
|
|
181
|
+
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "none" | null | undefined;
|
|
182
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
183
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
184
|
+
/**
|
|
185
|
+
* @param width - Width of the skeleton
|
|
186
|
+
* @description string or number, number unit is px
|
|
187
|
+
* @default 100
|
|
188
|
+
*/
|
|
189
|
+
width?: string | number;
|
|
190
|
+
/**
|
|
191
|
+
* @param height - Height of the skeleton
|
|
192
|
+
* @description string or number, number unit is px
|
|
193
|
+
* @default 100
|
|
194
|
+
*/
|
|
195
|
+
height?: string | number;
|
|
196
|
+
/**
|
|
197
|
+
* @param size - Size of the skeleton (height)
|
|
198
|
+
* @default sm
|
|
199
|
+
* @property
|
|
200
|
+
* - xs: 4px
|
|
201
|
+
* - sm: 8px
|
|
202
|
+
* - md: 12px
|
|
203
|
+
* - lg: 16px
|
|
204
|
+
* - xl: 20px
|
|
205
|
+
* - 2xl: 24px
|
|
206
|
+
* - 3xl: 28px
|
|
207
|
+
* - square: 100%
|
|
208
|
+
* - full: 100%
|
|
209
|
+
*/
|
|
210
|
+
size?: VariantProps<typeof classes>['size'];
|
|
211
|
+
/**
|
|
212
|
+
* @param rounded - Rounded of the skeleton
|
|
213
|
+
* @default sm
|
|
214
|
+
* @property
|
|
215
|
+
* - none: 0
|
|
216
|
+
* - sm: 2px
|
|
217
|
+
* - md: 6px
|
|
218
|
+
* - lg: 8px
|
|
219
|
+
* - xl: 12px
|
|
220
|
+
* - 2xl: 16px
|
|
221
|
+
* - 3xl: 20px
|
|
222
|
+
* - full: 100%
|
|
223
|
+
*/
|
|
224
|
+
rounded?: VariantProps<typeof classes>['rounded'];
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @param size - Size of the skeleton (height)
|
|
228
|
+
* @param rounded - Rounded of the skeleton
|
|
229
|
+
* @param width - Width of the skeleton
|
|
230
|
+
* @param height - Height of the skeleton
|
|
231
|
+
* @param className - Class name
|
|
232
|
+
*/
|
|
233
|
+
declare function Skeleton({
|
|
234
|
+
size,
|
|
235
|
+
rounded,
|
|
236
|
+
width,
|
|
237
|
+
height,
|
|
238
|
+
className,
|
|
239
|
+
...props
|
|
240
|
+
}: SkeletonProps): react_jsx_runtime0.JSX.Element;
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/ui/tooltip/tooltip-container.d.ts
|
|
243
|
+
type SubPlacement = 'start' | 'end';
|
|
244
|
+
type MainPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
245
|
+
type TooltipPlacement = MainPlacement | `${MainPlacement}-${SubPlacement}`;
|
|
246
|
+
interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
247
|
+
/**
|
|
248
|
+
* @param children - Trigger element
|
|
249
|
+
*/
|
|
250
|
+
children: React.ReactNode;
|
|
251
|
+
/**
|
|
252
|
+
* @param content - Tooltip content
|
|
253
|
+
*/
|
|
254
|
+
content: string;
|
|
255
|
+
/**
|
|
256
|
+
* @param placement - Placement of the tooltip
|
|
257
|
+
* @default top
|
|
258
|
+
* @property
|
|
259
|
+
* - top
|
|
260
|
+
* - bottom
|
|
261
|
+
* - left
|
|
262
|
+
* - right
|
|
263
|
+
* - top-start
|
|
264
|
+
* - top-end
|
|
265
|
+
* - bottom-start
|
|
266
|
+
* - bottom-end
|
|
267
|
+
* - left-start
|
|
268
|
+
* - left-end
|
|
269
|
+
* - right-start
|
|
270
|
+
* - right-end
|
|
271
|
+
*/
|
|
272
|
+
placement?: TooltipPlacement;
|
|
273
|
+
/**
|
|
274
|
+
* @param defaultOpen - Default open state of the tooltip
|
|
275
|
+
* @default false
|
|
276
|
+
* @property
|
|
277
|
+
* - true: Open the tooltip
|
|
278
|
+
* - false: Close the tooltip
|
|
279
|
+
*/
|
|
280
|
+
defaultOpen?: boolean;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* @param children - Trigger element
|
|
284
|
+
* @param content - Tooltip content
|
|
285
|
+
* @param defaultOpen - Default open state of the tooltip
|
|
286
|
+
* @param className - Class name
|
|
287
|
+
* @param placement - Placement of the tooltip
|
|
288
|
+
*/
|
|
289
|
+
declare const TooltipContainer: react2.ForwardRefExoticComponent<TooltipContainerProps & react2.RefAttributes<HTMLDivElement>>;
|
|
290
|
+
//#endregion
|
|
291
|
+
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"../util-DCPr_-5a.mjs";import{t}from"../hooks-5I2NBtcY.mjs";import{debounce as n}from"lodash-es";import r from"clsx";import i,{forwardRef as a,useCallback as o,useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{createPortal as m}from"react-dom";function h({className:e,items:t,render:n,...a}){return d(`nav`,{className:r(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0 komc:box-border`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...a,children:d(`div`,{className:`komc:grid komc:min-h-15 komc:p-0`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>d(i.Fragment,{children:n(e)},t))})})}const g=p(e(`komc:inline-flex komc:justify-center komc:items-center komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:*:transition-colors komc:*:duration-200 komc:cursor-pointer`,`komc:disabled:cursor-default komc:disabled:opacity-50 komc:disabled:pointer-events-none`,`komc:whitespace-nowrap komc:shrink-0 komc:outline-none komc:box-border`),{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`,"2.5xl":`komc:rounded-[20px]`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`},variant:{default:``,ghost:`komc:bg-transparent komc:text-neutral-900`,white:`komc:bg-white komc:text-neutral-900 komc:hover:bg-neutral-100`,blue:`komc:bg-blue-500 komc:text-white komc:hover:bg-blue-600`,night:`komc:bg-[#2c5cb7] komc:text-white komc:hover:bg-[#26539F]`,charcoal:`komc:bg-[#36454F] komc:text-white komc:hover:bg-[#2E3A43]`,slate:`komc:bg-[#4A5565] komc:text-white komc:hover:bg-[#424A57]`,red:`komc:bg-[#C8313A] komc:text-white komc:hover:bg-[#B02B33]`,yellow:`komc:bg-[#E7FF14] komc:text-black komc:hover:bg-[#D4E600]`,black:`komc:bg-[rgb(95,95,96)] komc:text-white komc:hover:bg-[rgb(76,76,77)] komc:active:bg-[rgb(76,76,77)]`}},defaultVariants:{size:void 0,outline:void 0,rounded:void 0,variant:void 0}});var _=a(({children:e=`button`,type:t=`button`,size:n=`md`,gap:r=`sm`,outline:i=`line`,rounded:a=`sm`,variant:o=`blue`,className:s,...c},l)=>d(`button`,{ref:l,type:t,className:g({size:n,outline:i,gap:r,rounded:a,variant:o,className:s}),...c,children:e}));function v({condition:e,wrapper:t,children:n}){return e?t(n):n}const y=p(e(`komc:flex komc:items-center komc:w-full komc:px-2 komc:box-border`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:border-none komc:[&>input]:h-full`,`komc:[&>input]:p-0 komc:[&>input]:m-0`),{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 b=a(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:a=`lg`,className:o,...s},c)=>f(`div`,{className:y({size:n,gap:r,outline:i,rounded:a,className:o}),children:[e,d(`input`,{ref:c,type:`text`,...s}),t]}));const x=p(e(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},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`}},defaultVariants:{size:`sm`,rounded:`sm`}});function S({size:e,rounded:t,width:n,height:r,className:i,...a}){let o=n?typeof n==`string`?n:`${n}px`:void 0,s=r?typeof r==`string`?r:`${r}px`:void 0;return d(`div`,{className:x({size:e,rounded:t,className:i}),style:{width:o,height:s},...a})}function C({children:e,setOpen:t}){return d(`div`,{className:r(`komc:inline-flex komc:shrink-0 komc:justify-center komc:items-center`,`komc:bg-transparent komc:border-none komc:outline-none`,`komc:p-0 komc:m-0 komc:box-border`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const w=p(e(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2`,`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)]`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,left:``,right:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``,"left-start":``,"left-end":``,"right-start":``,"right-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`left`,className:`komc:-translate-x-2`},{portal:!0,placement:`right`,className:`komc:translate-x-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:!0,placement:`left-start`,className:`komc:-translate-x-2`},{portal:!0,placement:`left-end`,className:`komc:-translate-x-2`},{portal:!0,placement:`right-start`,className:`komc:translate-x-2`},{portal:!0,placement:`right-end`,className:`komc:translate-x-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:`left`,className:`komc:right-full komc:top-1/2 komc:-translate-y-1/2`},{portal:!1,placement:`right`,className:`komc:left-full komc:top-1/2 komc:-translate-y-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`},{portal:!1,placement:`left-start`,className:`komc:right-full komc:top-0`},{portal:!1,placement:`left-end`,className:`komc:right-full komc:bottom-0`},{portal:!1,placement:`right-start`,className:`komc:left-full komc:top-0`},{portal:!1,placement:`right-end`,className:`komc:left-full komc:bottom-0`}],defaultVariants:{placement:`top`,portal:!1}});var T=a(({portal:e,children:t,className:n,placement:r,...i},a)=>d(`div`,{ref:a,role:`tooltip`,className:w({portal:e,placement:r,className:n}),...i,children:t}));const E=p(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`),left:e(`komc:left-full komc:-ml-1 komc:top-1/2`),right:e(`komc:right-full komc:-mr-1 komc:top-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`),"left-start":e(`komc:left-full komc:-ml-1 komc:top-3`),"left-end":e(`komc:left-full komc:-ml-1 komc:bottom-3`),"right-start":e(`komc:right-full komc:-mr-1 komc:top-3`),"right-end":e(`komc:right-full komc:-mr-1 komc:bottom-3`)}},defaultVariants:{placement:`top`}});var D=({placement:e,className:t,offset:n,style:r,...i})=>{let a=c(()=>{switch(e){case`top`:return`rotate(45deg)`;case`bottom`:return`rotate(225deg)`;case`left`:return`rotate(-45deg)`;case`right`:return`rotate(135deg)`;case`top-start`:return`rotate(45deg)`;case`top-end`:return`rotate(45deg)`;case`bottom-start`:return`rotate(225deg)`;case`bottom-end`:return`rotate(225deg)`;case`left-start`:return`rotate(-45deg)`;case`left-end`:return`rotate(-45deg)`;case`right-start`:return`rotate(135deg)`;case`right-end`:return`rotate(135deg)`;default:return`rotate(45deg)`}},[e]);return d(`div`,{className:E({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const O=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function k({placement:e,className:t,content:i,open:a,hiddenRef:c,containerRef:p}){let[h,g]=u(!1),_=l(null),[v,y]=u(e),[b,x]=u({top:0,left:0}),[S,C]=u({x:0,y:0}),w=o(n(()=>{let e=p?.current,t=c.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.scrollY||document.documentElement.scrollTop,a=window.scrollX||document.documentElement.scrollLeft,[o,s]=v.split(`-`),l=i+n.top,u=a+n.left+n.width/2-r.width/2;switch(o){case`top`:l-=r.height;break;case`bottom`:l+=n.height;break;case`left`:l+=n.height/2-r.height/2,u-=r.width/2+n.width/2;break;case`right`:l+=n.height/2-r.height/2,u+=r.width/2+n.width/2;break}if([`top`,`bottom`].includes(o))switch(s){case`start`:u+=r.width/2-24;break;case`end`:u-=r.width/2-24;break}if([`left`,`right`].includes(o))switch(s){case`start`:l+=r.height/2+n.height/2-24;break;case`end`:l-=r.height/2+n.height/2-24;break}let d=u,f=window.innerWidth;d+r.width>f-4&&(d=f-r.width-4),d<4&&(d=4),x({top:l,left:d}),C({x:u-d,y:0})},50),[v]),E=o(n(()=>{if(!c.current)return;let{top:t,height:n}=c.current.getBoundingClientRect();y(r=>{let i=e;return t+n>=window.innerHeight?i=O(r,`top`):t<0&&(i=O(r,`bottom`)),i})},50),[e]);return s(()=>(g(!0),E(),window.addEventListener(`scroll`,w,{passive:!0}),window.addEventListener(`resize`,w),window.addEventListener(`scroll`,E,{passive:!0}),window.addEventListener(`resize`,E),()=>{window.removeEventListener(`scroll`,w),window.removeEventListener(`resize`,w),window.removeEventListener(`scroll`,E),window.removeEventListener(`resize`,E)}),[w,E]),s(()=>{h&&w()},[h,w]),h?m(f(T,{ref:_,portal:!0,placement:v,className:r(t,a?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[d(`span`,{children:i}),d(D,{placement:v,offset:S})]}),document.body):null}var A=a(({children:e,content:n,defaultOpen:i=!1,className:a,placement:o=`top`},s)=>{let[c,p]=u(i),m=l(null),h=l(null);return t({ref:m,setOpen:p}),f(`div`,{ref:m,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[d(C,{setOpen:p,children:e}),d(k,{placement:o,className:a,open:c,content:n,hiddenRef:h,containerRef:m}),d(T,{ref:h,role:`presentation`,placement:o,className:r(`komc:opacity-0 komc:invisible`,a),children:d(`span`,{children:n})})]})});export{h as BottomAppBar,_ as Button,v as ConditionalWrapper,b as Input,S as Skeleton,A as Tooltip};
|
package/dist/util/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../
|
|
1
|
+
const e=require(`../util-CDkao6z3.cjs`);exports.appendSearchPath=e.P,exports.calcPageCount=e.d,exports.clearQueryByKey=e.F,exports.clearSearchPath=e.I,exports.cn=e.f,exports.comparePriorityAsc=e.p,exports.composeKey=e.m,exports.deleteAllSearchHistory=e.L,exports.deleteSearchHistory=e.R,exports.displayDatetime=e.o,exports.existLeastOne=e.h,exports.formatBytes=e.s,exports.formatI18nNumber=e.g,exports.genNanoID=e.t,exports.generatePage=e.n,exports.generatePageGroup=e.r,exports.getCookie=e.z,exports.getFileExtension=e.c,exports.getFilename=e.l,exports.getFirstLocationAddress=e._,exports.getFullAddress=e.v,exports.getI18nKey=e.y,exports.getI18nValue=e.b,exports.getI18nValues=e.x,exports.getModelName=e.S,exports.getSearchHistory=e.B,exports.insertSearchHistory=e.V,exports.isSearchPage=e.H,exports.link=e.C,exports.loadExLib=e.w,exports.parsePath=e.u,exports.parseQuery=e.T,exports.printNanoID=e.i,exports.productSlugify=e.E,exports.randomNum=e.a,exports.recomposeI18nNumber=e.D,exports.selectItemByWeight=e.O,exports.setCookies=e.U,exports.shuffle=e.k,exports.sleep=e.A,exports.slugify=e.j,exports.withoutProperties=e.M,exports.withoutProperty=e.N;
|