@aivex/ui 1.2.0-dev.49 → 1.2.0-dev.50
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/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +2 -4
- package/dist/components/Avatar/Avatar.js +31 -29
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +25 -25
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.js +10 -10
- package/dist/components/Comment/MentionInput.cjs +1 -1
- package/dist/components/Comment/MentionInput.js +8 -8
- package/dist/components/Comment/MentionList.cjs +1 -1
- package/dist/components/Comment/MentionList.js +36 -36
- package/dist/components/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/DataGrid/DataGrid.js +108 -108
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.cjs +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.js +36 -36
- package/dist/components/DataGrid/DataGridPrimitives.cjs +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.js +48 -48
- package/dist/components/DataGrid/DataGridRows.cjs +1 -1
- package/dist/components/DataGrid/DataGridRows.js +24 -24
- package/dist/components/DraggableScroll/DraggableScroll.cjs +1 -1
- package/dist/components/DraggableScroll/DraggableScroll.js +5 -5
- package/dist/components/Field/Field.cjs +1 -1
- package/dist/components/Field/Field.js +34 -34
- package/dist/components/FilterModal/FilterModal.cjs +1 -1
- package/dist/components/FilterModal/FilterModal.js +24 -24
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.js +51 -51
- package/dist/components/Pagination/Pagination.cjs +1 -1
- package/dist/components/Pagination/Pagination.js +24 -24
- package/dist/components/Radio/Radio.cjs +1 -1
- package/dist/components/Radio/Radio.js +9 -9
- package/dist/components/Segmented/Segmented.cjs +1 -1
- package/dist/components/Segmented/Segmented.js +12 -12
- package/dist/components/SelectBox/SelectBox.cjs +1 -1
- package/dist/components/SelectBox/SelectBox.js +12 -12
- package/dist/components/ShapeEditor/ShapeEditor.cjs +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.js +367 -367
- package/dist/components/ShapeEditor/ShapeEditor.js.map +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.cjs +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.js +17 -17
- package/dist/components/ShapeEditor/_components/CursorGuide.cjs +1 -1
- package/dist/components/ShapeEditor/_components/CursorGuide.js +7 -7
- package/dist/components/ShapeEditor/_components/Minimap.cjs +1 -1
- package/dist/components/ShapeEditor/_components/Minimap.js +29 -29
- package/dist/components/ShapeEditor/_components/MinimapShape.cjs +1 -1
- package/dist/components/ShapeEditor/_components/MinimapShape.cjs.map +1 -1
- package/dist/components/ShapeEditor/_components/MinimapShape.js +9 -9
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.js +10 -10
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.js +7 -7
- package/dist/components/Tagbox/Tagbox.cjs +1 -1
- package/dist/components/Tagbox/Tagbox.js +7 -7
- package/dist/components/Textarea/Textarea.cjs +1 -1
- package/dist/components/Textarea/Textarea.js +9 -9
- package/dist/components/Textbox/Textbox.cjs +1 -1
- package/dist/components/Textbox/Textbox.js +7 -7
- package/dist/components/UploadArea/UploadArea.cjs +1 -1
- package/dist/components/UploadArea/UploadArea.js +19 -19
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`),n=require(`../Tooltip/Tooltip.cjs`);let r=require(`@radix-ui/react-avatar`);r=e.__toESM(r,1);let i=require(`class-variance-authority`),a=require(`react/jsx-runtime`);var
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`),n=require(`../Tooltip/Tooltip.cjs`);let r=require(`@radix-ui/react-avatar`);r=e.__toESM(r,1);let i=require(`class-variance-authority`),a=require(`react`),o=require(`react/jsx-runtime`);var s=(0,i.cva)(`aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:overflow-hidden aivex:select-none aivex:leading-none aivex:text-text-primary`,{variants:{size:{xxs:`aivex:w-4 aivex:h-4 aivex:text-label-sm`,xs:`aivex:w-5 aivex:h-5 aivex:text-label-md`,sm:`aivex:w-6 aivex:h-6 aivex:text-label-md`,md:`aivex:w-8 aivex:h-8 aivex:text-label-lg`,lg:`aivex:w-9 aivex:h-9 aivex:text-label-xl`,xl:`aivex:w-12 aivex:h-12 aivex:text-label-xl`,"2xl":`aivex:w-14 aivex:h-14 aivex:text-label-xl`},type:{round:`aivex:rounded-full aivex:bg-category-indigo-bg`,square:`aivex:bg-category-indigo-bg`,image:`aivex:rounded-full aivex:border aivex:border-border-subtle aivex:bg-bg-secondary`}},compoundVariants:[{type:`square`,size:[`xxs`,`xs`,`sm`],className:`aivex:rounded-xs`},{type:`square`,size:[`md`,`lg`],className:`aivex:rounded-sm`},{type:`square`,size:[`xl`,`2xl`],className:`aivex:rounded-md`}],defaultVariants:{size:`md`,type:`round`}}),c=[`aivex:bg-category-blue-bg aivex:text-category-blue-text`,`aivex:bg-category-green-bg aivex:text-category-green-text`,`aivex:bg-category-orange-bg aivex:text-category-orange-text`,`aivex:bg-category-violet-bg aivex:text-category-violet-text`,`aivex:bg-category-teal-bg aivex:text-category-teal-text`,`aivex:bg-category-pink-bg aivex:text-category-pink-text`,`aivex:bg-category-cyan-bg aivex:text-category-cyan-text`,`aivex:bg-category-red-bg aivex:text-category-red-text`,`aivex:bg-category-lime-bg aivex:text-category-lime-text`,`aivex:bg-category-yellow-bg aivex:text-category-yellow-text`,`aivex:bg-category-indigo-bg aivex:text-category-indigo-text`];function l(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return c[t%c.length]}function u({initials:e,name:t,icon:n}){return(e??t?.trim().slice(0,1).toUpperCase())||(n??null)}function d({className:e,size:i,type:c,src:d,alt:f,initials:p,icon:m,name:h,bgColor:g,showTooltip:_,style:v,ref:y,...b}){let x=u({initials:p,name:h,icon:m}),S=h??p,C=!d&&!g&&S?l(S):void 0,[w,T]=(0,a.useState)(`idle`),E=!!d&&w!==`loaded`&&w!==`error`,D=(0,o.jsxs)(r.Root,{ref:y,"aria-busy":E||void 0,className:t.cn(s({size:i,type:c}),C,E&&`aivex-skeleton aivex:bg-bg-tertiary`,e),style:g&&!E?{backgroundColor:g,...v}:v,...b,children:[d&&(0,o.jsx)(r.Image,{src:d,alt:f??`avatar`,className:`aivex:w-full aivex:h-full aivex:object-cover`,onLoadingStatusChange:T}),!E&&(0,o.jsx)(r.Fallback,{className:`aivex:inline-flex aivex:h-full aivex:w-full aivex:items-center aivex:justify-center aivex:leading-none`,children:x})]});return _&&h?(0,o.jsx)(n.Tooltip,{content:h,children:D}):D}exports.Avatar=d,exports.avatarVariants=s;
|
|
2
2
|
//# sourceMappingURL=Avatar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.cjs","names":[],"sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type
|
|
1
|
+
{"version":3,"file":"Avatar.cjs","names":[],"sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { type HTMLAttributes, type ReactNode, type Ref, useState } from \"react\";\nimport { Tooltip } from \"@/components/Tooltip\";\nimport { cn } from \"@/utils/cn\";\n\nconst avatarVariants = cva(\n \"aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:overflow-hidden aivex:select-none aivex:leading-none aivex:text-text-primary\",\n {\n variants: {\n size: {\n xxs: \"aivex:w-4 aivex:h-4 aivex:text-label-sm\",\n xs: \"aivex:w-5 aivex:h-5 aivex:text-label-md\",\n sm: \"aivex:w-6 aivex:h-6 aivex:text-label-md\",\n md: \"aivex:w-8 aivex:h-8 aivex:text-label-lg\",\n lg: \"aivex:w-9 aivex:h-9 aivex:text-label-xl\",\n xl: \"aivex:w-12 aivex:h-12 aivex:text-label-xl\",\n \"2xl\": \"aivex:w-14 aivex:h-14 aivex:text-label-xl\",\n },\n type: {\n round: \"aivex:rounded-full aivex:bg-category-indigo-bg\",\n square: \"aivex:bg-category-indigo-bg\",\n image: \"aivex:rounded-full aivex:border aivex:border-border-subtle aivex:bg-bg-secondary\",\n },\n },\n // Square shape: size-scaled radius per Figma\n compoundVariants: [\n { type: \"square\", size: [\"xxs\", \"xs\", \"sm\"], className: \"aivex:rounded-xs\" },\n { type: \"square\", size: [\"md\", \"lg\"], className: \"aivex:rounded-sm\" },\n { type: \"square\", size: [\"xl\", \"2xl\"], className: \"aivex:rounded-md\" },\n ],\n defaultVariants: { size: \"md\", type: \"round\" },\n },\n);\n\ntype ImageLoadingStatus = Parameters<\n NonNullable<AvatarPrimitive.AvatarImageProps[\"onLoadingStatusChange\"]>\n>[0];\n\nexport interface AvatarProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"children\">,\n VariantProps<typeof avatarVariants> {\n src?: string;\n alt?: string;\n initials?: string;\n icon?: ReactNode;\n name?: string;\n bgColor?: string;\n showTooltip?: boolean;\n ref?: Ref<HTMLSpanElement>;\n}\n\n/** name(또는 initials) 기반으로 결정적 색을 고르기 위한 카테고리 팔레트 */\nconst avatarColorClasses = [\n \"aivex:bg-category-blue-bg aivex:text-category-blue-text\",\n \"aivex:bg-category-green-bg aivex:text-category-green-text\",\n \"aivex:bg-category-orange-bg aivex:text-category-orange-text\",\n \"aivex:bg-category-violet-bg aivex:text-category-violet-text\",\n \"aivex:bg-category-teal-bg aivex:text-category-teal-text\",\n \"aivex:bg-category-pink-bg aivex:text-category-pink-text\",\n \"aivex:bg-category-cyan-bg aivex:text-category-cyan-text\",\n \"aivex:bg-category-red-bg aivex:text-category-red-text\",\n \"aivex:bg-category-lime-bg aivex:text-category-lime-text\",\n \"aivex:bg-category-yellow-bg aivex:text-category-yellow-text\",\n \"aivex:bg-category-indigo-bg aivex:text-category-indigo-text\",\n] as const;\n\nfunction pickColorClass(key: string): string {\n let hash = 0;\n for (let i = 0; i < key.length; i++) {\n hash = (hash * 31 + key.charCodeAt(i)) >>> 0;\n }\n return avatarColorClasses[hash % avatarColorClasses.length];\n}\n\nfunction resolveFallback({\n initials,\n name,\n icon,\n}: Pick<AvatarProps, \"initials\" | \"name\" | \"icon\">): ReactNode {\n const text = initials ?? name?.trim().slice(0, 1).toUpperCase();\n if (text) return text;\n return icon ?? null;\n}\n\nfunction Avatar({\n className,\n size,\n type,\n src,\n alt,\n initials,\n icon,\n name,\n bgColor,\n showTooltip,\n style,\n ref,\n ...props\n}: AvatarProps) {\n const fallback = resolveFallback({ initials, name, icon });\n // src/bgColor가 없으면 name(없으면 initials) 기준으로 카테고리 색을 자동 배정한다.\n const colorSeed = name ?? initials;\n const autoColorClass = !src && !bgColor && colorSeed ? pickColorClass(colorSeed) : undefined;\n // 사진을 받는 동안엔 색·이니셜 대신 스켈레톤을 보이고, 실패했을 때만 이니셜로 대체한다.\n const [status, setStatus] = useState<ImageLoadingStatus>(\"idle\");\n const loading = !!src && status !== \"loaded\" && status !== \"error\";\n\n const avatar = (\n <AvatarPrimitive.Root\n ref={ref}\n aria-busy={loading || undefined}\n className={cn(\n avatarVariants({ size, type }),\n autoColorClass,\n loading && \"aivex-skeleton aivex:bg-bg-tertiary\",\n className,\n )}\n style={bgColor && !loading ? { backgroundColor: bgColor, ...style } : style}\n {...props}\n >\n {src && (\n <AvatarPrimitive.Image\n src={src}\n alt={alt ?? \"avatar\"}\n className=\"aivex:w-full aivex:h-full aivex:object-cover\"\n onLoadingStatusChange={setStatus}\n />\n )}\n {!loading && (\n <AvatarPrimitive.Fallback className=\"aivex:inline-flex aivex:h-full aivex:w-full aivex:items-center aivex:justify-center aivex:leading-none\">\n {fallback}\n </AvatarPrimitive.Fallback>\n )}\n </AvatarPrimitive.Root>\n );\n\n return showTooltip && name ? <Tooltip content={name}>{avatar}</Tooltip> : avatar;\n}\n\nexport { Avatar, avatarVariants };\n"],"mappings":"2RAMA,IAAM,GAAA,EAAA,EAAA,KACJ,8JACA,CACE,SAAU,CACR,KAAM,CACJ,IAAK,0CACL,GAAI,0CACJ,GAAI,0CACJ,GAAI,0CACJ,GAAI,0CACJ,GAAI,4CACJ,MAAO,4CACR,CACD,KAAM,CACJ,MAAO,iDACP,OAAQ,8BACR,MAAO,mFACR,CACF,CAED,iBAAkB,CAChB,CAAE,KAAM,SAAU,KAAM,CAAC,MAAO,KAAM,KAAK,CAAE,UAAW,mBAAoB,CAC5E,CAAE,KAAM,SAAU,KAAM,CAAC,KAAM,KAAK,CAAE,UAAW,mBAAoB,CACrE,CAAE,KAAM,SAAU,KAAM,CAAC,KAAM,MAAM,CAAE,UAAW,mBAAoB,CACvE,CACD,gBAAiB,CAAE,KAAM,KAAM,KAAM,QAAS,CAC/C,CACF,CAoBK,EAAqB,CACzB,0DACA,4DACA,8DACA,8DACA,0DACA,0DACA,0DACA,wDACA,0DACA,8DACA,8DACD,CAED,SAAS,EAAe,EAAqB,CAC3C,IAAI,EAAO,EACX,IAAK,IAAI,EAAI,EAAG,EAAI,EAAI,OAAQ,IAC9B,EAAQ,EAAO,GAAK,EAAI,WAAW,EAAE,GAAM,EAE7C,OAAO,EAAmB,EAAO,EAAmB,QAGtD,SAAS,EAAgB,CACvB,WACA,OACA,QAC6D,CAG7D,OAFa,GAAY,GAAM,MAAM,CAAC,MAAM,EAAG,EAAE,CAAC,aAAa,IAExD,GAAQ,MAGjB,SAAS,EAAO,CACd,YACA,OACA,OACA,MACA,MACA,WACA,OACA,OACA,UACA,cACA,QACA,MACA,GAAG,GACW,CACd,IAAM,EAAW,EAAgB,CAAE,WAAU,OAAM,OAAM,CAAC,CAEpD,EAAY,GAAQ,EACpB,EAAiB,CAAC,GAAO,CAAC,GAAW,EAAY,EAAe,EAAU,CAAG,IAAA,GAE7E,CAAC,EAAQ,IAAA,EAAA,EAAA,UAA0C,OAAO,CAC1D,EAAU,CAAC,CAAC,GAAO,IAAW,UAAY,IAAW,QAErD,GACJ,EAAA,EAAA,MAAC,EAAgB,KAAjB,CACO,MACL,YAAW,GAAW,IAAA,GACtB,UAAW,EAAA,GACT,EAAe,CAAE,OAAM,OAAM,CAAC,CAC9B,EACA,GAAW,sCACX,EACD,CACD,MAAO,GAAW,CAAC,EAAU,CAAE,gBAAiB,EAAS,GAAG,EAAO,CAAG,EACtE,GAAI,WAVN,CAYG,IACC,EAAA,EAAA,KAAC,EAAgB,MAAjB,CACO,MACL,IAAK,GAAO,SACZ,UAAU,+CACV,sBAAuB,EACvB,CAAA,CAEH,CAAC,IACA,EAAA,EAAA,KAAC,EAAgB,SAAjB,CAA0B,UAAU,kHACjC,EACwB,CAAA,CAER,GAGzB,OAAO,GAAe,GAAO,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,QAAS,WAAO,EAAiB,CAAA,CAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
|
-
import type
|
|
2
|
+
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
3
3
|
declare const avatarVariants: (props?: ({
|
|
4
4
|
size?: "2xl" | "lg" | "md" | "sm" | "xl" | "xs" | "xxs" | null | undefined;
|
|
5
5
|
type?: "image" | "round" | "square" | null | undefined;
|
|
@@ -12,9 +12,7 @@ export interface AvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, "chil
|
|
|
12
12
|
name?: string;
|
|
13
13
|
bgColor?: string;
|
|
14
14
|
showTooltip?: boolean;
|
|
15
|
-
/** Fallback render delay in ms (only applies when `src` is provided). Default: 600ms. */
|
|
16
|
-
delayMs?: number;
|
|
17
15
|
ref?: Ref<HTMLSpanElement>;
|
|
18
16
|
}
|
|
19
|
-
declare function Avatar({ className, size, type, src, alt, initials, icon, name, bgColor, showTooltip,
|
|
17
|
+
declare function Avatar({ className, size, type, src, alt, initials, icon, name, bgColor, showTooltip, style, ref, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
18
|
export { Avatar, avatarVariants };
|
|
@@ -3,9 +3,10 @@ import { cn as e } from "../../utils.js";
|
|
|
3
3
|
import { Tooltip as t } from "../Tooltip/Tooltip.js";
|
|
4
4
|
import * as n from "@radix-ui/react-avatar";
|
|
5
5
|
import { cva as r } from "class-variance-authority";
|
|
6
|
-
import {
|
|
6
|
+
import { useState as i } from "react";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/Avatar/Avatar.tsx
|
|
8
|
-
var
|
|
9
|
+
var s = r("aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:overflow-hidden aivex:select-none aivex:leading-none aivex:text-text-primary", {
|
|
9
10
|
variants: {
|
|
10
11
|
size: {
|
|
11
12
|
xxs: "aivex:w-4 aivex:h-4 aivex:text-label-sm",
|
|
@@ -47,7 +48,7 @@ var o = r("aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrin
|
|
|
47
48
|
size: "md",
|
|
48
49
|
type: "round"
|
|
49
50
|
}
|
|
50
|
-
}),
|
|
51
|
+
}), c = [
|
|
51
52
|
"aivex:bg-category-blue-bg aivex:text-category-blue-text",
|
|
52
53
|
"aivex:bg-category-green-bg aivex:text-category-green-text",
|
|
53
54
|
"aivex:bg-category-orange-bg aivex:text-category-orange-text",
|
|
@@ -60,46 +61,47 @@ var o = r("aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrin
|
|
|
60
61
|
"aivex:bg-category-yellow-bg aivex:text-category-yellow-text",
|
|
61
62
|
"aivex:bg-category-indigo-bg aivex:text-category-indigo-text"
|
|
62
63
|
];
|
|
63
|
-
function
|
|
64
|
+
function l(e) {
|
|
64
65
|
let t = 0;
|
|
65
66
|
for (let n = 0; n < e.length; n++) t = t * 31 + e.charCodeAt(n) >>> 0;
|
|
66
|
-
return
|
|
67
|
+
return c[t % c.length];
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
+
function u({ initials: e, name: t, icon: n }) {
|
|
69
70
|
return (e ?? t?.trim().slice(0, 1).toUpperCase()) || (n ?? null);
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
let S =
|
|
73
|
-
initials:
|
|
74
|
-
name:
|
|
75
|
-
icon:
|
|
76
|
-
}), C =
|
|
72
|
+
function d({ className: r, size: c, type: d, src: f, alt: p, initials: m, icon: h, name: g, bgColor: _, showTooltip: v, style: y, ref: b, ...x }) {
|
|
73
|
+
let S = u({
|
|
74
|
+
initials: m,
|
|
75
|
+
name: g,
|
|
76
|
+
icon: h
|
|
77
|
+
}), C = g ?? m, w = !f && !_ && C ? l(C) : void 0, [T, E] = i("idle"), D = !!f && T !== "loaded" && T !== "error", O = /* @__PURE__ */ o(n.Root, {
|
|
77
78
|
ref: b,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
"aria-busy": D || void 0,
|
|
80
|
+
className: e(s({
|
|
81
|
+
size: c,
|
|
82
|
+
type: d
|
|
83
|
+
}), w, D && "aivex-skeleton aivex:bg-bg-tertiary", r),
|
|
84
|
+
style: _ && !D ? {
|
|
85
|
+
backgroundColor: _,
|
|
84
86
|
...y
|
|
85
87
|
} : y,
|
|
86
88
|
...x,
|
|
87
|
-
children: [
|
|
88
|
-
src:
|
|
89
|
-
alt:
|
|
90
|
-
className: "aivex:w-full aivex:h-full aivex:object-cover"
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
children: [f && /* @__PURE__ */ a(n.Image, {
|
|
90
|
+
src: f,
|
|
91
|
+
alt: p ?? "avatar",
|
|
92
|
+
className: "aivex:w-full aivex:h-full aivex:object-cover",
|
|
93
|
+
onLoadingStatusChange: E
|
|
94
|
+
}), !D && /* @__PURE__ */ a(n.Fallback, {
|
|
93
95
|
className: "aivex:inline-flex aivex:h-full aivex:w-full aivex:items-center aivex:justify-center aivex:leading-none",
|
|
94
96
|
children: S
|
|
95
97
|
})]
|
|
96
98
|
});
|
|
97
|
-
return
|
|
98
|
-
content:
|
|
99
|
-
children:
|
|
100
|
-
}) :
|
|
99
|
+
return v && g ? /* @__PURE__ */ a(t, {
|
|
100
|
+
content: g,
|
|
101
|
+
children: O
|
|
102
|
+
}) : O;
|
|
101
103
|
}
|
|
102
104
|
//#endregion
|
|
103
|
-
export {
|
|
105
|
+
export { d as Avatar, s as avatarVariants };
|
|
104
106
|
|
|
105
107
|
//# sourceMappingURL=Avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","names":[],"sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type
|
|
1
|
+
{"version":3,"file":"Avatar.js","names":[],"sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { type HTMLAttributes, type ReactNode, type Ref, useState } from \"react\";\nimport { Tooltip } from \"@/components/Tooltip\";\nimport { cn } from \"@/utils/cn\";\n\nconst avatarVariants = cva(\n \"aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:overflow-hidden aivex:select-none aivex:leading-none aivex:text-text-primary\",\n {\n variants: {\n size: {\n xxs: \"aivex:w-4 aivex:h-4 aivex:text-label-sm\",\n xs: \"aivex:w-5 aivex:h-5 aivex:text-label-md\",\n sm: \"aivex:w-6 aivex:h-6 aivex:text-label-md\",\n md: \"aivex:w-8 aivex:h-8 aivex:text-label-lg\",\n lg: \"aivex:w-9 aivex:h-9 aivex:text-label-xl\",\n xl: \"aivex:w-12 aivex:h-12 aivex:text-label-xl\",\n \"2xl\": \"aivex:w-14 aivex:h-14 aivex:text-label-xl\",\n },\n type: {\n round: \"aivex:rounded-full aivex:bg-category-indigo-bg\",\n square: \"aivex:bg-category-indigo-bg\",\n image: \"aivex:rounded-full aivex:border aivex:border-border-subtle aivex:bg-bg-secondary\",\n },\n },\n // Square shape: size-scaled radius per Figma\n compoundVariants: [\n { type: \"square\", size: [\"xxs\", \"xs\", \"sm\"], className: \"aivex:rounded-xs\" },\n { type: \"square\", size: [\"md\", \"lg\"], className: \"aivex:rounded-sm\" },\n { type: \"square\", size: [\"xl\", \"2xl\"], className: \"aivex:rounded-md\" },\n ],\n defaultVariants: { size: \"md\", type: \"round\" },\n },\n);\n\ntype ImageLoadingStatus = Parameters<\n NonNullable<AvatarPrimitive.AvatarImageProps[\"onLoadingStatusChange\"]>\n>[0];\n\nexport interface AvatarProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"children\">,\n VariantProps<typeof avatarVariants> {\n src?: string;\n alt?: string;\n initials?: string;\n icon?: ReactNode;\n name?: string;\n bgColor?: string;\n showTooltip?: boolean;\n ref?: Ref<HTMLSpanElement>;\n}\n\n/** name(또는 initials) 기반으로 결정적 색을 고르기 위한 카테고리 팔레트 */\nconst avatarColorClasses = [\n \"aivex:bg-category-blue-bg aivex:text-category-blue-text\",\n \"aivex:bg-category-green-bg aivex:text-category-green-text\",\n \"aivex:bg-category-orange-bg aivex:text-category-orange-text\",\n \"aivex:bg-category-violet-bg aivex:text-category-violet-text\",\n \"aivex:bg-category-teal-bg aivex:text-category-teal-text\",\n \"aivex:bg-category-pink-bg aivex:text-category-pink-text\",\n \"aivex:bg-category-cyan-bg aivex:text-category-cyan-text\",\n \"aivex:bg-category-red-bg aivex:text-category-red-text\",\n \"aivex:bg-category-lime-bg aivex:text-category-lime-text\",\n \"aivex:bg-category-yellow-bg aivex:text-category-yellow-text\",\n \"aivex:bg-category-indigo-bg aivex:text-category-indigo-text\",\n] as const;\n\nfunction pickColorClass(key: string): string {\n let hash = 0;\n for (let i = 0; i < key.length; i++) {\n hash = (hash * 31 + key.charCodeAt(i)) >>> 0;\n }\n return avatarColorClasses[hash % avatarColorClasses.length];\n}\n\nfunction resolveFallback({\n initials,\n name,\n icon,\n}: Pick<AvatarProps, \"initials\" | \"name\" | \"icon\">): ReactNode {\n const text = initials ?? name?.trim().slice(0, 1).toUpperCase();\n if (text) return text;\n return icon ?? null;\n}\n\nfunction Avatar({\n className,\n size,\n type,\n src,\n alt,\n initials,\n icon,\n name,\n bgColor,\n showTooltip,\n style,\n ref,\n ...props\n}: AvatarProps) {\n const fallback = resolveFallback({ initials, name, icon });\n // src/bgColor가 없으면 name(없으면 initials) 기준으로 카테고리 색을 자동 배정한다.\n const colorSeed = name ?? initials;\n const autoColorClass = !src && !bgColor && colorSeed ? pickColorClass(colorSeed) : undefined;\n // 사진을 받는 동안엔 색·이니셜 대신 스켈레톤을 보이고, 실패했을 때만 이니셜로 대체한다.\n const [status, setStatus] = useState<ImageLoadingStatus>(\"idle\");\n const loading = !!src && status !== \"loaded\" && status !== \"error\";\n\n const avatar = (\n <AvatarPrimitive.Root\n ref={ref}\n aria-busy={loading || undefined}\n className={cn(\n avatarVariants({ size, type }),\n autoColorClass,\n loading && \"aivex-skeleton aivex:bg-bg-tertiary\",\n className,\n )}\n style={bgColor && !loading ? { backgroundColor: bgColor, ...style } : style}\n {...props}\n >\n {src && (\n <AvatarPrimitive.Image\n src={src}\n alt={alt ?? \"avatar\"}\n className=\"aivex:w-full aivex:h-full aivex:object-cover\"\n onLoadingStatusChange={setStatus}\n />\n )}\n {!loading && (\n <AvatarPrimitive.Fallback className=\"aivex:inline-flex aivex:h-full aivex:w-full aivex:items-center aivex:justify-center aivex:leading-none\">\n {fallback}\n </AvatarPrimitive.Fallback>\n )}\n </AvatarPrimitive.Root>\n );\n\n return showTooltip && name ? <Tooltip content={name}>{avatar}</Tooltip> : avatar;\n}\n\nexport { Avatar, avatarVariants };\n"],"mappings":";;;;;;;;AAMA,IAAM,IAAiB,EACrB,+JACA;CACE,UAAU;EACR,MAAM;GACJ,KAAK;GACL,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACR;EACD,MAAM;GACJ,OAAO;GACP,QAAQ;GACR,OAAO;GACR;EACF;CAED,kBAAkB;EAChB;GAAE,MAAM;GAAU,MAAM;IAAC;IAAO;IAAM;IAAK;GAAE,WAAW;GAAoB;EAC5E;GAAE,MAAM;GAAU,MAAM,CAAC,MAAM,KAAK;GAAE,WAAW;GAAoB;EACrE;GAAE,MAAM;GAAU,MAAM,CAAC,MAAM,MAAM;GAAE,WAAW;GAAoB;EACvE;CACD,iBAAiB;EAAE,MAAM;EAAM,MAAM;EAAS;CAC/C,CACF,EAoBK,IAAqB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAS,EAAe,GAAqB;CAC3C,IAAI,IAAO;AACX,MAAK,IAAI,IAAI,GAAG,IAAI,EAAI,QAAQ,IAC9B,KAAQ,IAAO,KAAK,EAAI,WAAW,EAAE,KAAM;AAE7C,QAAO,EAAmB,IAAO,EAAmB;;AAGtD,SAAS,EAAgB,EACvB,aACA,SACA,WAC6D;AAG7D,SAFa,KAAY,GAAM,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,aAAa,MAExD,KAAQ;;AAGjB,SAAS,EAAO,EACd,cACA,SACA,SACA,QACA,QACA,aACA,SACA,SACA,YACA,gBACA,UACA,QACA,GAAG,KACW;CACd,IAAM,IAAW,EAAgB;EAAE;EAAU;EAAM;EAAM,CAAC,EAEpD,IAAY,KAAQ,GACpB,IAAiB,CAAC,KAAO,CAAC,KAAW,IAAY,EAAe,EAAU,GAAG,KAAA,GAE7E,CAAC,GAAQ,KAAa,EAA6B,OAAO,EAC1D,IAAU,CAAC,CAAC,KAAO,MAAW,YAAY,MAAW,SAErD,IACJ,kBAAC,EAAgB,MAAjB;EACO;EACL,aAAW,KAAW,KAAA;EACtB,WAAW,EACT,EAAe;GAAE;GAAM;GAAM,CAAC,EAC9B,GACA,KAAW,uCACX,EACD;EACD,OAAO,KAAW,CAAC,IAAU;GAAE,iBAAiB;GAAS,GAAG;GAAO,GAAG;EACtE,GAAI;YAVN,CAYG,KACC,kBAAC,EAAgB,OAAjB;GACO;GACL,KAAK,KAAO;GACZ,WAAU;GACV,uBAAuB;GACvB,CAAA,EAEH,CAAC,KACA,kBAAC,EAAgB,UAAjB;GAA0B,WAAU;aACjC;GACwB,CAAA,CAER;;AAGzB,QAAO,KAAe,IAAO,kBAAC,GAAD;EAAS,SAAS;YAAO;EAAiB,CAAA,GAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../InteractionLayer/InteractionLayer.cjs`),n=require(`../Icon/index.cjs`),r=require(`../Button/Button.cjs`),i=require(`./date.cjs`);let a=require(`react
|
|
1
|
+
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../InteractionLayer/InteractionLayer.cjs`),n=require(`../Icon/index.cjs`),r=require(`../Button/Button.cjs`),i=require(`./date.cjs`);let a=require(`react`),o=require(`react/jsx-runtime`);var s=[`SUNDAY`,`MONDAY`,`TUESDAY`,`WEDNESDAY`,`THURSDAY`,`FRIDAY`,`SATURDAY`];function c({locale:c=`ko-KR`,weekStartsOn:u=`SUNDAY`,prevMonthLabel:d,nextMonthLabel:f,month:p,selected:m,rangeStart:h,rangeEnd:g,onSelectDay:_,markedDates:v,minDate:y,maxDate:b,disabledDate:x,onPrevMonth:S,onNextMonth:C,weekdayLabels:w,formatMonthTitle:T,className:E}){let{monthFormatter:D,weekdayFormatter:O,dayFormatter:k}=(0,a.useMemo)(()=>({monthFormatter:new Intl.DateTimeFormat(c,{calendar:`gregory`,year:`numeric`,month:`long`}),weekdayFormatter:new Intl.DateTimeFormat(c,{weekday:`short`}),dayFormatter:new Intl.NumberFormat(c,{useGrouping:!1})}),[c]),A=T?.(p)??D.format(p),j=+(u===`MONDAY`),M=i.getMonthWeeks(p,j),N=[...s.slice(j),...s.slice(0,j)],P=h??m??null,F=g??m??null,I=!!(P&&F&&!i.isSameDay(P,F)),L=e=>y&&i.isBeforeDay(e,y)||b&&i.isAfterDay(e,b)?!0:x?x(e):!1,R=e=>v?.some(t=>i.isSameDay(t,e))??!1;return(0,o.jsxs)(`div`,{className:e.cn(`aivex:flex aivex:w-[280px] aivex:flex-col aivex:gap-lg`,E),children:[(0,o.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:items-center aivex:gap-md`,children:[(0,o.jsx)(l,{children:S&&(0,o.jsx)(r.Button,{variant:`outline`,color:`secondary`,size:`icon-md`,"aria-label":d??D.format(i.addMonths(p,-1)),onClick:S,children:(0,o.jsx)(n.DirectionLeftIcon,{size:20})})}),(0,o.jsx)(`span`,{className:`aivex:flex-1 aivex:text-center aivex:text-heading-sm aivex:text-text-primary aivex:select-none`,children:A}),(0,o.jsx)(l,{children:C&&(0,o.jsx)(r.Button,{variant:`outline`,color:`secondary`,size:`icon-md`,"aria-label":f??D.format(i.addMonths(p,1)),onClick:C,children:(0,o.jsx)(n.DirectionRightIcon,{size:20})})})]}),(0,o.jsxs)(`div`,{className:`aivex:flex aivex:flex-col aivex:gap-xs`,children:[(0,o.jsx)(`div`,{className:`aivex:flex`,children:N.map(t=>(0,o.jsx)(`span`,{className:e.cn(`aivex:flex aivex:size-10 aivex:items-center aivex:justify-center aivex:text-label-lg aivex:select-none`,t===`SUNDAY`?`aivex:text-text-danger`:`aivex:text-text-primary`),children:w?.[t]??O.format(new Date(2023,0,1+s.indexOf(t)))},t))}),M.map((n,r)=>(0,o.jsx)(`div`,{className:`aivex:flex`,children:n.map((n,r)=>{if(!n)return(0,o.jsx)(`span`,{className:`aivex:size-10`},r);let a=L(n),s=!!(P&&i.isSameDay(n,P)),c=!!(F&&i.isSameDay(n,F)),l=s||c,u=I&&P&&F&&!i.isBeforeDay(n,P)&&!i.isAfterDay(n,F),d=n.getDay()===0;return(0,o.jsxs)(`button`,{type:`button`,disabled:a,onClick:()=>_?.(n),"aria-pressed":l,className:e.cn(`aivex:group aivex:relative aivex:size-10 aivex:cursor-pointer aivex:select-none`,`aivex:outline-none aivex:focus-visible:z-10 aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:focus-visible:rounded-md`,a&&`aivex:pointer-events-none`),children:[u&&(0,o.jsx)(`span`,{className:e.cn(`aivex:absolute aivex:inset-x-0 aivex:top-1/2 aivex:h-9 aivex:-translate-y-1/2 aivex:bg-bg-tertiary`,s&&`aivex:rounded-l-full`,c&&`aivex:rounded-r-full`)}),l&&(0,o.jsx)(`span`,{className:`aivex:absolute aivex:top-1/2 aivex:left-1/2 aivex:size-9 aivex:-translate-x-1/2 aivex:-translate-y-1/2 aivex:rounded-md aivex:bg-bg-brand`}),!a&&(0,o.jsx)(t.InteractionLayer,{fill:!1,className:`aivex:top-1/2 aivex:left-1/2 aivex:size-9 aivex:-translate-x-1/2 aivex:-translate-y-1/2 aivex:rounded-md`}),(0,o.jsx)(`span`,{className:e.cn(`aivex:relative aivex:text-label-lg`,a?`aivex:text-text-disabled`:l?`aivex:text-text-on-color`:d?`aivex:text-text-danger`:`aivex:text-text-primary`),children:k.format(n.getDate())}),!a&&R(n)&&(0,o.jsx)(`span`,{className:e.cn(`aivex:absolute aivex:top-1 aivex:left-[calc(50%+11px)] aivex:size-1.5 aivex:-translate-x-1/2 aivex:rounded-full`,l?`aivex:bg-icon-on-color`:`aivex:bg-icon-brand`)})]},n.getTime())})},r))]})]})}function l({children:e}){return(0,o.jsx)(`span`,{className:`aivex:flex aivex:size-8 aivex:shrink-0`,children:e})}exports.Calendar=c;
|
|
2
2
|
//# sourceMappingURL=Calendar.cjs.map
|
|
@@ -5,8 +5,8 @@ import { InteractionLayer as t } from "../InteractionLayer/InteractionLayer.js";
|
|
|
5
5
|
import { DirectionLeftIcon as n, DirectionRightIcon as r } from "../Icon/index.js";
|
|
6
6
|
import { Button as i } from "../Button/Button.js";
|
|
7
7
|
import { addMonths as a, getMonthWeeks as o, isAfterDay as s, isBeforeDay as c, isSameDay as l } from "./date.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useMemo as u } from "react";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/Calendar/Calendar.tsx
|
|
11
11
|
var p = [
|
|
12
12
|
"SUNDAY",
|
|
@@ -18,7 +18,7 @@ var p = [
|
|
|
18
18
|
"SATURDAY"
|
|
19
19
|
];
|
|
20
20
|
function m({ locale: m = "ko-KR", weekStartsOn: g = "SUNDAY", prevMonthLabel: _, nextMonthLabel: v, month: y, selected: b, rangeStart: x, rangeEnd: S, onSelectDay: C, markedDates: w, minDate: T, maxDate: E, disabledDate: D, onPrevMonth: O, onNextMonth: k, weekdayLabels: A, formatMonthTitle: j, className: M }) {
|
|
21
|
-
let { monthFormatter: N, weekdayFormatter: P, dayFormatter: F } =
|
|
21
|
+
let { monthFormatter: N, weekdayFormatter: P, dayFormatter: F } = u(() => ({
|
|
22
22
|
monthFormatter: new Intl.DateTimeFormat(m, {
|
|
23
23
|
calendar: "gregory",
|
|
24
24
|
year: "numeric",
|
|
@@ -27,63 +27,63 @@ function m({ locale: m = "ko-KR", weekStartsOn: g = "SUNDAY", prevMonthLabel: _,
|
|
|
27
27
|
weekdayFormatter: new Intl.DateTimeFormat(m, { weekday: "short" }),
|
|
28
28
|
dayFormatter: new Intl.NumberFormat(m, { useGrouping: !1 })
|
|
29
29
|
}), [m]), I = j?.(y) ?? N.format(y), L = +(g === "MONDAY"), R = o(y, L), z = [...p.slice(L), ...p.slice(0, L)], B = x ?? b ?? null, V = S ?? b ?? null, H = !!(B && V && !l(B, V)), U = (e) => T && c(e, T) || E && s(e, E) ? !0 : D ? D(e) : !1, W = (e) => w?.some((t) => l(t, e)) ?? !1;
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ f("div", {
|
|
31
31
|
className: e("aivex:flex aivex:w-[280px] aivex:flex-col aivex:gap-lg", M),
|
|
32
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ f("div", {
|
|
33
33
|
className: "aivex:flex aivex:w-full aivex:items-center aivex:gap-md",
|
|
34
34
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ d(h, { children: O && /* @__PURE__ */ d(i, {
|
|
36
36
|
variant: "outline",
|
|
37
37
|
color: "secondary",
|
|
38
38
|
size: "icon-md",
|
|
39
39
|
"aria-label": _ ?? N.format(a(y, -1)),
|
|
40
40
|
onClick: O,
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ d(n, { size: 20 })
|
|
42
42
|
}) }),
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ d("span", {
|
|
44
44
|
className: "aivex:flex-1 aivex:text-center aivex:text-heading-sm aivex:text-text-primary aivex:select-none",
|
|
45
45
|
children: I
|
|
46
46
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ d(h, { children: k && /* @__PURE__ */ d(i, {
|
|
48
48
|
variant: "outline",
|
|
49
49
|
color: "secondary",
|
|
50
50
|
size: "icon-md",
|
|
51
51
|
"aria-label": v ?? N.format(a(y, 1)),
|
|
52
52
|
onClick: k,
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ d(r, { size: 20 })
|
|
54
54
|
}) })
|
|
55
55
|
]
|
|
56
|
-
}), /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ f("div", {
|
|
57
57
|
className: "aivex:flex aivex:flex-col aivex:gap-xs",
|
|
58
|
-
children: [/* @__PURE__ */
|
|
58
|
+
children: [/* @__PURE__ */ d("div", {
|
|
59
59
|
className: "aivex:flex",
|
|
60
|
-
children: z.map((t) => /* @__PURE__ */
|
|
60
|
+
children: z.map((t) => /* @__PURE__ */ d("span", {
|
|
61
61
|
className: e("aivex:flex aivex:size-10 aivex:items-center aivex:justify-center aivex:text-label-lg aivex:select-none", t === "SUNDAY" ? "aivex:text-text-danger" : "aivex:text-text-primary"),
|
|
62
62
|
children: A?.[t] ?? P.format(new Date(2023, 0, 1 + p.indexOf(t)))
|
|
63
63
|
}, t))
|
|
64
|
-
}), R.map((n, r) => /* @__PURE__ */
|
|
64
|
+
}), R.map((n, r) => /* @__PURE__ */ d("div", {
|
|
65
65
|
className: "aivex:flex",
|
|
66
66
|
children: n.map((n, r) => {
|
|
67
|
-
if (!n) return /* @__PURE__ */
|
|
68
|
-
let i = U(n), a = !!(B && l(n, B)), o = !!(V && l(n, V)),
|
|
69
|
-
return /* @__PURE__ */
|
|
67
|
+
if (!n) return /* @__PURE__ */ d("span", { className: "aivex:size-10" }, r);
|
|
68
|
+
let i = U(n), a = !!(B && l(n, B)), o = !!(V && l(n, V)), u = a || o, p = H && B && V && !c(n, B) && !s(n, V), m = n.getDay() === 0;
|
|
69
|
+
return /* @__PURE__ */ f("button", {
|
|
70
70
|
type: "button",
|
|
71
71
|
disabled: i,
|
|
72
72
|
onClick: () => C?.(n),
|
|
73
|
-
"aria-pressed":
|
|
73
|
+
"aria-pressed": u,
|
|
74
74
|
className: e("aivex:group aivex:relative aivex:size-10 aivex:cursor-pointer aivex:select-none", "aivex:outline-none aivex:focus-visible:z-10 aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:focus-visible:rounded-md", i && "aivex:pointer-events-none"),
|
|
75
75
|
children: [
|
|
76
|
-
p && /* @__PURE__ */
|
|
77
|
-
|
|
78
|
-
!i && /* @__PURE__ */
|
|
76
|
+
p && /* @__PURE__ */ d("span", { className: e("aivex:absolute aivex:inset-x-0 aivex:top-1/2 aivex:h-9 aivex:-translate-y-1/2 aivex:bg-bg-tertiary", a && "aivex:rounded-l-full", o && "aivex:rounded-r-full") }),
|
|
77
|
+
u && /* @__PURE__ */ d("span", { className: "aivex:absolute aivex:top-1/2 aivex:left-1/2 aivex:size-9 aivex:-translate-x-1/2 aivex:-translate-y-1/2 aivex:rounded-md aivex:bg-bg-brand" }),
|
|
78
|
+
!i && /* @__PURE__ */ d(t, {
|
|
79
79
|
fill: !1,
|
|
80
80
|
className: "aivex:top-1/2 aivex:left-1/2 aivex:size-9 aivex:-translate-x-1/2 aivex:-translate-y-1/2 aivex:rounded-md"
|
|
81
81
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
className: e("aivex:relative aivex:text-label-lg", i ? "aivex:text-text-disabled" :
|
|
82
|
+
/* @__PURE__ */ d("span", {
|
|
83
|
+
className: e("aivex:relative aivex:text-label-lg", i ? "aivex:text-text-disabled" : u ? "aivex:text-text-on-color" : m ? "aivex:text-text-danger" : "aivex:text-text-primary"),
|
|
84
84
|
children: F.format(n.getDate())
|
|
85
85
|
}),
|
|
86
|
-
!i && W(n) && /* @__PURE__ */
|
|
86
|
+
!i && W(n) && /* @__PURE__ */ d("span", { className: e("aivex:absolute aivex:top-1 aivex:left-[calc(50%+11px)] aivex:size-1.5 aivex:-translate-x-1/2 aivex:rounded-full", u ? "aivex:bg-icon-on-color" : "aivex:bg-icon-brand") })
|
|
87
87
|
]
|
|
88
88
|
}, n.getTime());
|
|
89
89
|
})
|
|
@@ -92,7 +92,7 @@ function m({ locale: m = "ko-KR", weekStartsOn: g = "SUNDAY", prevMonthLabel: _,
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
function h({ children: e }) {
|
|
95
|
-
return /* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ d("span", {
|
|
96
96
|
className: "aivex:flex aivex:size-8 aivex:shrink-0",
|
|
97
97
|
children: e
|
|
98
98
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../Icon/index.cjs`),n=require(`../InputBase/useInputState.cjs`),r=require(`../../utils/useControllableState.cjs`);let i=require(`class-variance-authority`),a=require(`react
|
|
1
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../Icon/index.cjs`),n=require(`../InputBase/useInputState.cjs`),r=require(`../../utils/useControllableState.cjs`);let i=require(`class-variance-authority`),a=require(`react`),o=require(`react/jsx-runtime`);var s=(0,i.cva)(`aivex:relative aivex:m-0 aivex:shrink-0 aivex:rounded-xs aivex:border aivex:border-border-default aivex:bg-bg-primary aivex:appearance-none aivex:cursor-pointer aivex:transition-colors aivex:peer`,{variants:{size:{sm:`aivex:w-4 aivex:h-4`,md:`aivex:w-[18px] aivex:h-[18px]`}},defaultVariants:{size:`md`}}),c={sm:`aivex:w-5 aivex:h-5`,md:`aivex:w-6 aivex:h-6`};function l({className:i,size:l=`md`,indeterminate:u=!1,disabled:d,checked:f,defaultChecked:p,onCheckedChange:m,onChange:h,id:g,ref:_,...v}){let y=(0,a.useRef)(null),[b,x]=r.useControllableState({value:f,defaultValue:!!p,onChange:m}),S=typeof _==`object`&&_?_:y;(0,a.useEffect)(()=>{S&&`current`in S&&S.current&&(S.current.indeterminate=u)},[u,S]);let C=!!b,w=C||u,T=l??`md`,E=n.isAriaInvalid(v[`aria-invalid`]);return(0,o.jsx)(`span`,{className:e.cn(`aivex:inline-flex aivex:items-center aivex:gap-md`,d&&`aivex:opacity-disable aivex:pointer-events-none`),children:(0,o.jsxs)(`span`,{className:e.cn(`aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:group`,c[T]),children:[(0,o.jsx)(`span`,{className:`aivex:absolute aivex:-inset-1 aivex:rounded-full aivex:bg-bg-inverse-strong aivex:opacity-0 aivex:group-hover:opacity-4 aivex:group-active:opacity-8 aivex:pointer-events-none aivex:transition-opacity`}),(0,o.jsx)(`input`,{ref:S,id:g,type:`checkbox`,disabled:d,checked:C,onChange:e=>{x(e.target.checked),h?.(e)},className:e.cn(s({size:T}),E&&`aivex:border-border-danger`,w&&`aivex:border-transparent aivex:bg-bg-brand`,i),...v}),w&&(0,o.jsx)(`span`,{className:`aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none`,children:u?(0,o.jsx)(t.CheckboxIndeterminateIcon,{size:T}):(0,o.jsx)(t.CheckboxCheckIcon,{size:T})})]})})}exports.Checkbox=l,exports.checkboxVariants=s;
|
|
2
2
|
//# sourceMappingURL=Checkbox.cjs.map
|
|
@@ -4,8 +4,8 @@ import { CheckboxCheckIcon as t, CheckboxIndeterminateIcon as n } from "../Icon/
|
|
|
4
4
|
import { isAriaInvalid as r } from "../InputBase/useInputState.js";
|
|
5
5
|
import { useControllableState as i } from "../../utils/useControllableState.js";
|
|
6
6
|
import { cva as a } from "class-variance-authority";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useEffect as o, useRef as s } from "react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/Checkbox/Checkbox.tsx
|
|
10
10
|
var u = a("aivex:relative aivex:m-0 aivex:shrink-0 aivex:rounded-xs aivex:border aivex:border-border-default aivex:bg-bg-primary aivex:appearance-none aivex:cursor-pointer aivex:transition-colors aivex:peer", {
|
|
11
11
|
variants: { size: {
|
|
@@ -18,22 +18,22 @@ var u = a("aivex:relative aivex:m-0 aivex:shrink-0 aivex:rounded-xs aivex:border
|
|
|
18
18
|
md: "aivex:w-6 aivex:h-6"
|
|
19
19
|
};
|
|
20
20
|
function f({ className: a, size: f = "md", indeterminate: p = !1, disabled: m, checked: h, defaultChecked: g, onCheckedChange: _, onChange: v, id: y, ref: b, ...x }) {
|
|
21
|
-
let S =
|
|
21
|
+
let S = s(null), [C, w] = i({
|
|
22
22
|
value: h,
|
|
23
23
|
defaultValue: !!g,
|
|
24
24
|
onChange: _
|
|
25
25
|
}), T = typeof b == "object" && b ? b : S;
|
|
26
|
-
|
|
26
|
+
o(() => {
|
|
27
27
|
T && "current" in T && T.current && (T.current.indeterminate = p);
|
|
28
28
|
}, [p, T]);
|
|
29
29
|
let E = !!C, D = E || p, O = f ?? "md", k = r(x["aria-invalid"]);
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ c("span", {
|
|
31
31
|
className: e("aivex:inline-flex aivex:items-center aivex:gap-md", m && "aivex:opacity-disable aivex:pointer-events-none"),
|
|
32
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ l("span", {
|
|
33
33
|
className: e("aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:group", d[O]),
|
|
34
34
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ c("span", { className: "aivex:absolute aivex:-inset-1 aivex:rounded-full aivex:bg-bg-inverse-strong aivex:opacity-0 aivex:group-hover:opacity-4 aivex:group-active:opacity-8 aivex:pointer-events-none aivex:transition-opacity" }),
|
|
36
|
+
/* @__PURE__ */ c("input", {
|
|
37
37
|
ref: T,
|
|
38
38
|
id: y,
|
|
39
39
|
type: "checkbox",
|
|
@@ -45,9 +45,9 @@ function f({ className: a, size: f = "md", indeterminate: p = !1, disabled: m, c
|
|
|
45
45
|
className: e(u({ size: O }), k && "aivex:border-border-danger", D && "aivex:border-transparent aivex:bg-bg-brand", a),
|
|
46
46
|
...x
|
|
47
47
|
}),
|
|
48
|
-
D && /* @__PURE__ */
|
|
48
|
+
D && /* @__PURE__ */ c("span", {
|
|
49
49
|
className: "aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none",
|
|
50
|
-
children:
|
|
50
|
+
children: c(p ? n : t, { size: O })
|
|
51
51
|
})
|
|
52
52
|
]
|
|
53
53
|
})
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./mentionContent.cjs`),n=require(`./useMentionSuggestion.cjs`);let r=require(`react
|
|
1
|
+
"use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./mentionContent.cjs`),n=require(`./useMentionSuggestion.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`@tiptap/extension-mention`);a=e.__toESM(a,1);let o=require(`@tiptap/extension-placeholder`);o=e.__toESM(o,1);let s=require(`@tiptap/react`),c=require(`@tiptap/starter-kit`);c=e.__toESM(c,1);function l({value:e,onChange:l,placeholder:u,onSubmit:d,onEscape:f,userList:p=[],initialContent:m,mentionEmptyText:h,autoFocus:g=!0,handleRef:_}){let v=(0,r.useRef)(null),[y,b]=(0,r.useState)(!1),x=n.useMentionSuggestion(p,b,h),S=(0,s.useEditor)({extensions:[c.default,o.default.configure({placeholder:u,emptyEditorClass:`aivex:before:content-[attr(data-placeholder)] aivex:before:text-text-tertiary aivex:before:absolute aivex:before:left-3`}),a.default.configure({HTMLAttributes:{class:`aivex:text-text-brand aivex:px-1`},renderHTML({options:e,node:t}){return[`span`,(0,s.mergeAttributes)(e.HTMLAttributes),`${t.attrs.label}`]},renderText({node:e}){return`@[${e.attrs.label}](${e.attrs.id})`},deleteTriggerWithBackspace:!0,suggestion:x})],content:m||t.parseContentToJSON(e),immediatelyRender:!1,editorProps:{attributes:{class:`aivex:px-3 aivex:py-1 aivex:rounded-lg aivex:border aivex:border-border-subtle aivex:bg-bg-secondary aivex:focus:border-border-brand aivex:outline-none aivex:text-body-md-regular aivex:text-text-primary aivex:cursor-text aivex:[&_p]:leading-[22px]`},handleKeyDown:(t,n)=>n.key===`Enter`?y||n.shiftKey||n.metaKey||n.ctrlKey||n.altKey?!1:(n.preventDefault(),e.trim()&&d&&d(),!0):n.key===`Escape`?y||!f?!1:(n.preventDefault(),f(),!0):!1},onUpdate:({editor:e})=>{l(t.extractContentFromJSON(e.getJSON()))}});return(0,r.useEffect)(()=>{if(!S||!y&&!f)return;let e=S.view,t=e.dom.ownerDocument.defaultView,n=t=>{t.key!==`Escape`||t.defaultPrevented||!(t.target instanceof Node)||!e.dom.contains(t.target)||e.someProp(`handleKeyDown`,n=>n(e,t))&&(t.preventDefault(),t.stopPropagation())};return t?.addEventListener(`keydown`,n,!0),()=>t?.removeEventListener(`keydown`,n,!0)},[S,y,f]),(0,r.useEffect)(()=>{S&&!m&&e!==t.extractContentFromJSON(S.getJSON())&&S.commands.setContent(t.parseContentToJSON(e))},[e,S,m]),(0,r.useEffect)(()=>{S&&g&&requestAnimationFrame(()=>{S.commands.focus()})},[S,g]),(0,r.useImperativeHandle)(_,()=>({focus:()=>{S?.commands.focus()}}),[S]),(0,i.jsx)(s.EditorContent,{ref:v,editor:S,className:`aivex:relative aivex:h-full aivex:w-full`,onKeyDown:e=>e.stopPropagation()})}exports.default=l;
|
|
2
2
|
//# sourceMappingURL=MentionInput.cjs.map
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { extractContentFromJSON as e, parseContentToJSON as t } from "./mentionContent.js";
|
|
4
4
|
import { useMentionSuggestion as n } from "./useMentionSuggestion.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useEffect as r, useImperativeHandle as i, useRef as a, useState as o } from "react";
|
|
6
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
7
7
|
import c from "@tiptap/extension-mention";
|
|
8
8
|
import l from "@tiptap/extension-placeholder";
|
|
9
9
|
import { EditorContent as u, mergeAttributes as d, useEditor as f } from "@tiptap/react";
|
|
10
10
|
import p from "@tiptap/starter-kit";
|
|
11
11
|
//#region src/components/Comment/MentionInput.tsx
|
|
12
12
|
function m({ value: m, onChange: h, placeholder: g, onSubmit: _, onEscape: v, userList: y = [], initialContent: b, mentionEmptyText: x, autoFocus: S = !0, handleRef: C }) {
|
|
13
|
-
let w =
|
|
13
|
+
let w = a(null), [T, E] = o(!1), D = n(y, E, x), O = f({
|
|
14
14
|
extensions: [
|
|
15
15
|
p,
|
|
16
16
|
l.configure({
|
|
@@ -43,7 +43,7 @@ function m({ value: m, onChange: h, placeholder: g, onSubmit: _, onEscape: v, us
|
|
|
43
43
|
h(e(t.getJSON()));
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
return
|
|
46
|
+
return r(() => {
|
|
47
47
|
if (!O || !T && !v) return;
|
|
48
48
|
let e = O.view, t = e.dom.ownerDocument.defaultView, n = (t) => {
|
|
49
49
|
t.key !== "Escape" || t.defaultPrevented || !(t.target instanceof Node) || !e.dom.contains(t.target) || e.someProp("handleKeyDown", (n) => n(e, t)) && (t.preventDefault(), t.stopPropagation());
|
|
@@ -53,19 +53,19 @@ function m({ value: m, onChange: h, placeholder: g, onSubmit: _, onEscape: v, us
|
|
|
53
53
|
O,
|
|
54
54
|
T,
|
|
55
55
|
v
|
|
56
|
-
]),
|
|
56
|
+
]), r(() => {
|
|
57
57
|
O && !b && m !== e(O.getJSON()) && O.commands.setContent(t(m));
|
|
58
58
|
}, [
|
|
59
59
|
m,
|
|
60
60
|
O,
|
|
61
61
|
b
|
|
62
|
-
]),
|
|
62
|
+
]), r(() => {
|
|
63
63
|
O && S && requestAnimationFrame(() => {
|
|
64
64
|
O.commands.focus();
|
|
65
65
|
});
|
|
66
|
-
}, [O, S]),
|
|
66
|
+
}, [O, S]), i(C, () => ({ focus: () => {
|
|
67
67
|
O?.commands.focus();
|
|
68
|
-
} }), [O]), /* @__PURE__ */
|
|
68
|
+
} }), [O]), /* @__PURE__ */ s(u, {
|
|
69
69
|
ref: w,
|
|
70
70
|
editor: O,
|
|
71
71
|
className: "aivex:relative aivex:h-full aivex:w-full",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../Avatar/Avatar.cjs`);let n=require(`react
|
|
1
|
+
"use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../Avatar/Avatar.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`);function i(e){e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`),e.removeAttribute(`aria-expanded`)}var a=(0,n.memo)(function({items:a,command:o,emptyText:s=`No results found.`,editor:c,open:l=!0,ref:u}){let[d,f]=(0,n.useState)(0),p=(0,n.useId)(),m=(0,n.useRef)([]),h=(0,n.useCallback)(e=>{let t=a[e];t&&o(t)},[a,o]),g=(0,n.useCallback)(e=>{f(t=>{let n=a.length;return e===`up`?(t+n-1)%n:(t+1)%n})},[a.length]),_=(0,n.useCallback)(e=>{switch(e.key){case`ArrowUp`:return g(`up`),!0;case`ArrowDown`:return g(`down`),!0;case`Enter`:return h(d),!0;default:return!1}},[g,h,d]);(0,n.useEffect)(()=>{f(0),m.current=a.map(()=>null)},[a]),(0,n.useEffect)(()=>{m.current[d]?.scrollIntoView({behavior:`smooth`,block:`nearest`})},[d]);let v=c?.view.dom,y=l&&a.length?`${p}-${d}`:null;return(0,n.useEffect)(()=>{if(v){if(!l||!a.length){i(v);return}v.setAttribute(`aria-controls`,p),v.setAttribute(`aria-expanded`,`true`),y?v.setAttribute(`aria-activedescendant`,y):v.removeAttribute(`aria-activedescendant`)}},[v,l,a.length,p,y]),(0,n.useEffect)(()=>{if(v)return()=>i(v)},[v]),(0,n.useImperativeHandle)(u,()=>({onKeyDown:_}),[_]),a.length?(0,r.jsx)(`div`,{id:p,role:`listbox`,className:`aivex:h-full aivex:max-h-[248px] aivex:min-w-[298px] aivex:max-w-[328px] aivex:overflow-y-auto aivex:rounded-lg aivex:border aivex:border-border-subtle aivex:bg-bg-primary aivex:py-2 aivex:shadow-xl`,children:a.map((n,i)=>(0,r.jsxs)(`div`,{id:`${p}-${i}`,role:`option`,"aria-selected":d===i,ref:e=>{m.current[i]=e},className:e.cn(`aivex:flex aivex:h-[52px] aivex:cursor-pointer aivex:items-center aivex:gap-2 aivex:px-4 aivex:py-2`,d===i&&`aivex:bg-bg-brand-subtle`),onClick:()=>h(i),children:[(0,r.jsx)(t.Avatar,{size:`sm`,src:n.avatarUrl,bgColor:n.color,name:n.name}),(0,r.jsxs)(`div`,{className:`aivex:flex aivex:max-w-[260px] aivex:flex-col`,children:[(0,r.jsx)(`div`,{className:`aivex:truncate aivex:text-label-md aivex:text-text-primary`,children:n.name}),n.email?(0,r.jsx)(`div`,{className:`aivex:truncate aivex:text-body-sm-regular aivex:text-text-secondary`,children:n.email}):null]})]},n.id))}):(0,r.jsx)(`div`,{className:`aivex:min-w-[298px] aivex:max-w-[328px] aivex:rounded-lg aivex:border aivex:border-border-subtle aivex:bg-bg-primary aivex:py-2 aivex:shadow-xl`,children:(0,r.jsx)(`div`,{className:`aivex:p-2 aivex:text-body-md-regular aivex:text-text-secondary`,children:s})})});exports.default=a;
|
|
2
2
|
//# sourceMappingURL=MentionList.cjs.map
|