@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
|
@@ -8,25 +8,25 @@ import { MINIMAP_VP_FILL as u, MINIMAP_VP_STROKE as d } from "../_constants.js";
|
|
|
8
8
|
import { MinimapShape as f } from "./MinimapShape.js";
|
|
9
9
|
import { RegionOverlay as p } from "./RegionOverlay.js";
|
|
10
10
|
import { SettingsPanel as m } from "./SettingsPanel.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { memo as h } from "react";
|
|
12
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/ShapeEditor/_components/Minimap.tsx
|
|
14
14
|
var v = {
|
|
15
15
|
"bottom-left": "aivex:bottom-2 aivex:left-2",
|
|
16
16
|
"bottom-right": "aivex:bottom-2 aivex:right-2",
|
|
17
17
|
"top-left": "aivex:top-2 aivex:left-2",
|
|
18
18
|
"top-right": "aivex:top-2 aivex:right-2"
|
|
19
|
-
}, y =
|
|
19
|
+
}, y = h(function({ image: h, imageUrl: y, imageVisible: b = !0, loading: x = !1, region: S, roiMaskId: C, shapes: w, view: T, viewDefaults: E, onChangeView: D, nav: O, registerShape: k, rectRef: A, zoomLabelRef: j, onZoom100: M, open: N, onToggleOpen: P, position: F = "bottom-left", showSettings: I = !0, settingsOpen: L, onToggleSettings: R, onCloseSettings: z, labels: B = l.minimap, settingsLabels: V, settingsItems: H }) {
|
|
20
20
|
let { offX: U, offY: W, dispW: G, dispH: K, zoomCentered: q } = O, J = F.startsWith("top"), Y = {
|
|
21
21
|
position: "absolute",
|
|
22
22
|
left: U,
|
|
23
23
|
top: W,
|
|
24
24
|
width: G,
|
|
25
25
|
height: K
|
|
26
|
-
}, X = /* @__PURE__ */
|
|
26
|
+
}, X = /* @__PURE__ */ g("div", {
|
|
27
27
|
className: `aivex:overflow-hidden aivex:rounded-sm aivex:transition-all aivex:duration-200 aivex:ease-in-out ${N ? `${J ? "aivex:mt-md" : "aivex:mb-md"} aivex:opacity-100` : "aivex:opacity-0"}`,
|
|
28
28
|
style: { maxHeight: N ? 204 : 0 },
|
|
29
|
-
children: /* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ g("div", {
|
|
30
30
|
style: {
|
|
31
31
|
width: 204,
|
|
32
32
|
height: 204
|
|
@@ -38,7 +38,7 @@ var v = {
|
|
|
38
38
|
onPointerCancel: x ? void 0 : O.endMinimapDrag,
|
|
39
39
|
onWheel: x ? void 0 : O.handleMinimapWheel,
|
|
40
40
|
"aria-busy": x,
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ _("div", {
|
|
42
42
|
style: {
|
|
43
43
|
position: "absolute",
|
|
44
44
|
inset: 0,
|
|
@@ -46,15 +46,15 @@ var v = {
|
|
|
46
46
|
transition: b ? "opacity 0.3s ease" : "none"
|
|
47
47
|
},
|
|
48
48
|
children: [
|
|
49
|
-
y && /* @__PURE__ */
|
|
49
|
+
y && /* @__PURE__ */ g("img", {
|
|
50
50
|
src: y,
|
|
51
51
|
alt: "",
|
|
52
52
|
crossOrigin: "anonymous",
|
|
53
53
|
draggable: !1,
|
|
54
54
|
style: Y
|
|
55
55
|
}),
|
|
56
|
-
T.showRegionMask && S && S.rects.length > 0 && /* @__PURE__ */
|
|
57
|
-
image:
|
|
56
|
+
T.showRegionMask && S && S.rects.length > 0 && /* @__PURE__ */ g(p, {
|
|
57
|
+
image: h,
|
|
58
58
|
region: S,
|
|
59
59
|
maskId: C,
|
|
60
60
|
width: G,
|
|
@@ -68,8 +68,8 @@ var v = {
|
|
|
68
68
|
pointerEvents: "none"
|
|
69
69
|
}
|
|
70
70
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
viewBox: `0 0 ${
|
|
71
|
+
/* @__PURE__ */ g("svg", {
|
|
72
|
+
viewBox: `0 0 ${h.w} ${h.h}`,
|
|
73
73
|
width: G,
|
|
74
74
|
height: K,
|
|
75
75
|
style: {
|
|
@@ -79,13 +79,13 @@ var v = {
|
|
|
79
79
|
pointerEvents: "none"
|
|
80
80
|
},
|
|
81
81
|
"aria-hidden": !0,
|
|
82
|
-
children: c(w).filter(s).map((e) => /* @__PURE__ */
|
|
82
|
+
children: c(w).filter(s).map((e) => /* @__PURE__ */ g(f, {
|
|
83
83
|
shape: e,
|
|
84
84
|
strokeSize: T.strokeSize,
|
|
85
85
|
register: k
|
|
86
86
|
}, e.id))
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ g("div", {
|
|
89
89
|
ref: A,
|
|
90
90
|
style: {
|
|
91
91
|
position: "absolute",
|
|
@@ -98,50 +98,50 @@ var v = {
|
|
|
98
98
|
]
|
|
99
99
|
})
|
|
100
100
|
})
|
|
101
|
-
}), Z = /* @__PURE__ */
|
|
101
|
+
}), Z = /* @__PURE__ */ _("div", {
|
|
102
102
|
className: "aivex:relative aivex:flex aivex:items-center aivex:gap-xs",
|
|
103
103
|
children: [
|
|
104
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ g(a, {
|
|
105
105
|
variant: "ghost",
|
|
106
106
|
size: "icon-md",
|
|
107
107
|
"aria-label": B.zoomOut,
|
|
108
108
|
onClick: () => q(1 / 1.2),
|
|
109
109
|
disabled: x,
|
|
110
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ g(n, { size: 20 })
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ g(a, {
|
|
113
113
|
variant: "ghost",
|
|
114
114
|
size: "md",
|
|
115
115
|
"aria-label": B.zoom100,
|
|
116
116
|
onClick: M,
|
|
117
117
|
disabled: x,
|
|
118
118
|
className: "aivex:w-[60px] aivex:tabular-nums",
|
|
119
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ g("span", {
|
|
120
120
|
ref: j,
|
|
121
121
|
children: "100%"
|
|
122
122
|
})
|
|
123
123
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ g(a, {
|
|
125
125
|
variant: "ghost",
|
|
126
126
|
size: "icon-md",
|
|
127
127
|
"aria-label": B.zoomIn,
|
|
128
128
|
onClick: () => q(1.2),
|
|
129
129
|
disabled: x,
|
|
130
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ g(r, { size: 20 })
|
|
131
131
|
}),
|
|
132
|
-
I && /* @__PURE__ */
|
|
132
|
+
I && /* @__PURE__ */ _(o, {
|
|
133
133
|
open: L,
|
|
134
134
|
onOpenChange: (e) => e ? R() : z(),
|
|
135
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ g(o.Trigger, {
|
|
136
136
|
asChild: !0,
|
|
137
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ g(a, {
|
|
138
138
|
variant: "ghost",
|
|
139
139
|
size: "icon-md",
|
|
140
140
|
"aria-label": B.viewSettings,
|
|
141
141
|
className: L ? "aivex:text-text-brand" : void 0,
|
|
142
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ g(i, { size: 20 })
|
|
143
143
|
})
|
|
144
|
-
}), /* @__PURE__ */
|
|
144
|
+
}), /* @__PURE__ */ g(m, {
|
|
145
145
|
value: T,
|
|
146
146
|
defaults: E,
|
|
147
147
|
onChange: D,
|
|
@@ -151,20 +151,20 @@ var v = {
|
|
|
151
151
|
alignEnd: F.endsWith("right")
|
|
152
152
|
})]
|
|
153
153
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ g(a, {
|
|
155
155
|
variant: "ghost",
|
|
156
156
|
size: "icon-md",
|
|
157
157
|
"aria-label": B.toggleMinimap,
|
|
158
158
|
title: "(M)",
|
|
159
159
|
onClick: P,
|
|
160
|
-
children: N ? /* @__PURE__ */
|
|
160
|
+
children: N ? /* @__PURE__ */ g(e, {
|
|
161
161
|
size: 20,
|
|
162
162
|
className: J ? "aivex:rotate-180" : void 0
|
|
163
|
-
}) : /* @__PURE__ */
|
|
163
|
+
}) : /* @__PURE__ */ g(t, { size: 20 })
|
|
164
164
|
})
|
|
165
165
|
]
|
|
166
166
|
});
|
|
167
|
-
return /* @__PURE__ */
|
|
167
|
+
return /* @__PURE__ */ _("div", {
|
|
168
168
|
className: `aivex:absolute ${v[F]} aivex:w-[220px] aivex:rounded-[12px] aivex:border aivex:border-border-subtle aivex:bg-bg-primary aivex:p-md aivex:shadow-[0_4px_12px_rgba(13,13,18,0.24)]`,
|
|
169
169
|
children: [J ? Z : X, J ? X : Z]
|
|
170
170
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../_model/geometry.cjs`),t=require(`../_model/shapeRenderStyle.cjs`);let n=require(`react/jsx-runtime`);var
|
|
1
|
+
"use client";require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../_model/geometry.cjs`),t=require(`../_model/shapeRenderStyle.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`);var i=(0,n.memo)(function({shape:n,strokeSize:i,register:a}){let{type:o,points:s}=n,c=t.resolveShapeRenderStyle(n,{strokeWidth:i}),l=e=>a?.(n.id,e),u={ref:l,stroke:c.color,strokeWidth:c.strokeWidth,strokeDasharray:c.dash?.join(` `),opacity:c.opacity,fill:c.fillVisible&&o!==e.SHAPE_TYPE.LINE?c.color:`none`,fillOpacity:c.fillAlpha,vectorEffect:`non-scaling-stroke`};if(o===e.SHAPE_TYPE.POINT)return(0,r.jsx)(`circle`,{ref:l,cx:s[0].x,cy:s[0].y,r:c.pointRadius,fill:c.color,opacity:c.opacity});if(o===e.SHAPE_TYPE.RECTANGLE||o===e.SHAPE_TYPE.ELLIPSE){let t=e.getBBox(s);return o===e.SHAPE_TYPE.ELLIPSE?(0,r.jsx)(`ellipse`,{cx:(t.minX+t.maxX)/2,cy:(t.minY+t.maxY)/2,rx:(t.maxX-t.minX)/2,ry:(t.maxY-t.minY)/2,...u}):(0,r.jsx)(`rect`,{x:t.minX,y:t.minY,width:t.maxX-t.minX,height:t.maxY-t.minY,...u})}let d=s.map(e=>`${e.x},${e.y}`).join(` `);return o===e.SHAPE_TYPE.LINE?(0,r.jsx)(`polyline`,{points:d,...u}):(0,r.jsx)(`polygon`,{points:d,fillRule:`evenodd`,...u})});exports.MinimapShape=i;
|
|
2
2
|
//# sourceMappingURL=MinimapShape.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimapShape.cjs","names":[],"sources":["../../../../src/components/ShapeEditor/_components/MinimapShape.tsx"],"sourcesContent":["import { memo } from \"react\";\nimport type { EditorShape } from \"../_model/geometry\";\nimport { getBBox, SHAPE_TYPE } from \"../_model/geometry\";\nimport { resolveShapeRenderStyle } from \"../_model/shapeRenderStyle\";\n\n// 미니맵용 도형 1개를 이미지 좌표 그대로 SVG로 렌더(부모 SVG viewBox가 축소 담당,\n// stroke는 non-scaling으로 화면 px 고정). 점 도형만 채움, 나머지는 외곽선.\nexport const MinimapShape = memo(function MinimapShape<TMeta>({\n shape,\n strokeSize,\n register,\n}: {\n shape: EditorShape<TMeta>;\n strokeSize?: number;\n register?: (id: string, el: SVGElement | null) => void;\n}) {\n const { type, points } = shape;\n const style = resolveShapeRenderStyle(shape, { strokeWidth: strokeSize });\n const ref = (el: SVGElement | null) => register?.(shape.id, el);\n const common = {\n ref,\n stroke: style.color,\n strokeWidth: style.strokeWidth,\n strokeDasharray: style.dash?.join(\" \"),\n opacity: style.opacity,\n fill: style.fillVisible && type !== SHAPE_TYPE.LINE ? style.color : \"none\",\n fillOpacity: style.fillAlpha,\n vectorEffect: \"non-scaling-stroke\" as const,\n };\n if (type === SHAPE_TYPE.POINT) {\n return (\n <circle\n ref={ref}\n cx={points[0].x}\n cy={points[0].y}\n r={style.pointRadius}\n fill={style.color}\n opacity={style.opacity}\n />\n );\n }\n if (type === SHAPE_TYPE.RECTANGLE || type === SHAPE_TYPE.ELLIPSE) {\n const b = getBBox(points);\n if (type === SHAPE_TYPE.ELLIPSE) {\n return (\n <ellipse\n cx={(b.minX + b.maxX) / 2}\n cy={(b.minY + b.maxY) / 2}\n rx={(b.maxX - b.minX) / 2}\n ry={(b.maxY - b.minY) / 2}\n {...common}\n />\n );\n }\n return (\n <rect x={b.minX} y={b.minY} width={b.maxX - b.minX} height={b.maxY - b.minY} {...common} />\n );\n }\n const pts = points.map((p) => `${p.x},${p.y}`).join(\" \");\n if (type === SHAPE_TYPE.LINE) return <polyline points={pts} {...common} />;\n // fillRule: 자기교차 폴리곤(도넛)의 구멍을 비운다 — 캔버스 렌더러들과 동일한 evenodd.\n return <polygon points={pts} fillRule=\"evenodd\" {...common} />; // POLYGON, ROTATED_RECTANGLE\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MinimapShape.cjs","names":[],"sources":["../../../../src/components/ShapeEditor/_components/MinimapShape.tsx"],"sourcesContent":["import { memo } from \"react\";\nimport type { EditorShape } from \"../_model/geometry\";\nimport { getBBox, SHAPE_TYPE } from \"../_model/geometry\";\nimport { resolveShapeRenderStyle } from \"../_model/shapeRenderStyle\";\n\n// 미니맵용 도형 1개를 이미지 좌표 그대로 SVG로 렌더(부모 SVG viewBox가 축소 담당,\n// stroke는 non-scaling으로 화면 px 고정). 점 도형만 채움, 나머지는 외곽선.\nexport const MinimapShape = memo(function MinimapShape<TMeta>({\n shape,\n strokeSize,\n register,\n}: {\n shape: EditorShape<TMeta>;\n strokeSize?: number;\n register?: (id: string, el: SVGElement | null) => void;\n}) {\n const { type, points } = shape;\n const style = resolveShapeRenderStyle(shape, { strokeWidth: strokeSize });\n const ref = (el: SVGElement | null) => register?.(shape.id, el);\n const common = {\n ref,\n stroke: style.color,\n strokeWidth: style.strokeWidth,\n strokeDasharray: style.dash?.join(\" \"),\n opacity: style.opacity,\n fill: style.fillVisible && type !== SHAPE_TYPE.LINE ? style.color : \"none\",\n fillOpacity: style.fillAlpha,\n vectorEffect: \"non-scaling-stroke\" as const,\n };\n if (type === SHAPE_TYPE.POINT) {\n return (\n <circle\n ref={ref}\n cx={points[0].x}\n cy={points[0].y}\n r={style.pointRadius}\n fill={style.color}\n opacity={style.opacity}\n />\n );\n }\n if (type === SHAPE_TYPE.RECTANGLE || type === SHAPE_TYPE.ELLIPSE) {\n const b = getBBox(points);\n if (type === SHAPE_TYPE.ELLIPSE) {\n return (\n <ellipse\n cx={(b.minX + b.maxX) / 2}\n cy={(b.minY + b.maxY) / 2}\n rx={(b.maxX - b.minX) / 2}\n ry={(b.maxY - b.minY) / 2}\n {...common}\n />\n );\n }\n return (\n <rect x={b.minX} y={b.minY} width={b.maxX - b.minX} height={b.maxY - b.minY} {...common} />\n );\n }\n const pts = points.map((p) => `${p.x},${p.y}`).join(\" \");\n if (type === SHAPE_TYPE.LINE) return <polyline points={pts} {...common} />;\n // fillRule: 자기교차 폴리곤(도넛)의 구멍을 비운다 — 캔버스 렌더러들과 동일한 evenodd.\n return <polygon points={pts} fillRule=\"evenodd\" {...common} />; // POLYGON, ROTATED_RECTANGLE\n});\n"],"mappings":"4MAOA,IAAa,GAAA,EAAA,EAAA,MAAoB,SAA6B,CAC5D,QACA,aACA,YAKC,CACD,GAAM,CAAE,OAAM,UAAW,EACnB,EAAQ,EAAA,wBAAwB,EAAO,CAAE,YAAa,EAAY,CAAC,CACnE,EAAO,GAA0B,IAAW,EAAM,GAAI,EAAG,CACzD,EAAS,CACb,MACA,OAAQ,EAAM,MACd,YAAa,EAAM,YACnB,gBAAiB,EAAM,MAAM,KAAK,IAAI,CACtC,QAAS,EAAM,QACf,KAAM,EAAM,aAAe,IAAS,EAAA,WAAW,KAAO,EAAM,MAAQ,OACpE,YAAa,EAAM,UACnB,aAAc,qBACf,CACD,GAAI,IAAS,EAAA,WAAW,MACtB,OACE,EAAA,EAAA,KAAC,SAAD,CACO,MACL,GAAI,EAAO,GAAG,EACd,GAAI,EAAO,GAAG,EACd,EAAG,EAAM,YACT,KAAM,EAAM,MACZ,QAAS,EAAM,QACf,CAAA,CAGN,GAAI,IAAS,EAAA,WAAW,WAAa,IAAS,EAAA,WAAW,QAAS,CAChE,IAAM,EAAI,EAAA,QAAQ,EAAO,CAYzB,OAXI,IAAS,EAAA,WAAW,SAEpB,EAAA,EAAA,KAAC,UAAD,CACE,IAAK,EAAE,KAAO,EAAE,MAAQ,EACxB,IAAK,EAAE,KAAO,EAAE,MAAQ,EACxB,IAAK,EAAE,KAAO,EAAE,MAAQ,EACxB,IAAK,EAAE,KAAO,EAAE,MAAQ,EACxB,GAAI,EACJ,CAAA,EAIJ,EAAA,EAAA,KAAC,OAAD,CAAM,EAAG,EAAE,KAAM,EAAG,EAAE,KAAM,MAAO,EAAE,KAAO,EAAE,KAAM,OAAQ,EAAE,KAAO,EAAE,KAAM,GAAI,EAAU,CAAA,CAG/F,IAAM,EAAM,EAAO,IAAK,GAAM,GAAG,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,IAAI,CAGxD,OAFI,IAAS,EAAA,WAAW,MAAa,EAAA,EAAA,KAAC,WAAD,CAAU,OAAQ,EAAK,GAAI,EAAU,CAAA,EAEnE,EAAA,EAAA,KAAC,UAAD,CAAS,OAAQ,EAAK,SAAS,UAAU,GAAI,EAAU,CAAA,EAC9D"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { SHAPE_TYPE as e, getBBox as t } from "../_model/geometry.js";
|
|
3
3
|
import { resolveShapeRenderStyle as n } from "../_model/shapeRenderStyle.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { memo as r } from "react";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/ShapeEditor/_components/MinimapShape.tsx
|
|
7
|
-
var a =
|
|
8
|
-
let { type: s, points: c } =
|
|
7
|
+
var a = r(function({ shape: r, strokeSize: a, register: o }) {
|
|
8
|
+
let { type: s, points: c } = r, l = n(r, { strokeWidth: a }), u = (e) => o?.(r.id, e), d = {
|
|
9
9
|
ref: u,
|
|
10
10
|
stroke: l.color,
|
|
11
11
|
strokeWidth: l.strokeWidth,
|
|
@@ -15,7 +15,7 @@ var a = i(function({ shape: i, strokeSize: a, register: o }) {
|
|
|
15
15
|
fillOpacity: l.fillAlpha,
|
|
16
16
|
vectorEffect: "non-scaling-stroke"
|
|
17
17
|
};
|
|
18
|
-
if (s === e.POINT) return /* @__PURE__ */
|
|
18
|
+
if (s === e.POINT) return /* @__PURE__ */ i("circle", {
|
|
19
19
|
ref: u,
|
|
20
20
|
cx: c[0].x,
|
|
21
21
|
cy: c[0].y,
|
|
@@ -25,13 +25,13 @@ var a = i(function({ shape: i, strokeSize: a, register: o }) {
|
|
|
25
25
|
});
|
|
26
26
|
if (s === e.RECTANGLE || s === e.ELLIPSE) {
|
|
27
27
|
let n = t(c);
|
|
28
|
-
return s === e.ELLIPSE ? /* @__PURE__ */
|
|
28
|
+
return s === e.ELLIPSE ? /* @__PURE__ */ i("ellipse", {
|
|
29
29
|
cx: (n.minX + n.maxX) / 2,
|
|
30
30
|
cy: (n.minY + n.maxY) / 2,
|
|
31
31
|
rx: (n.maxX - n.minX) / 2,
|
|
32
32
|
ry: (n.maxY - n.minY) / 2,
|
|
33
33
|
...d
|
|
34
|
-
}) : /* @__PURE__ */
|
|
34
|
+
}) : /* @__PURE__ */ i("rect", {
|
|
35
35
|
x: n.minX,
|
|
36
36
|
y: n.minY,
|
|
37
37
|
width: n.maxX - n.minX,
|
|
@@ -40,10 +40,10 @@ var a = i(function({ shape: i, strokeSize: a, register: o }) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
let f = c.map((e) => `${e.x},${e.y}`).join(" ");
|
|
43
|
-
return s === e.LINE ? /* @__PURE__ */
|
|
43
|
+
return s === e.LINE ? /* @__PURE__ */ i("polyline", {
|
|
44
44
|
points: f,
|
|
45
45
|
...d
|
|
46
|
-
}) : /* @__PURE__ */
|
|
46
|
+
}) : /* @__PURE__ */ i("polygon", {
|
|
47
47
|
points: f,
|
|
48
48
|
fillRule: "evenodd",
|
|
49
49
|
...d
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`),n=require(`../../utils/useControllableState.cjs`);let r=require(`react
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`),n=require(`../../utils/useControllableState.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`),a=require(`@radix-ui/react-slider`);a=e.__toESM(a,1);var o={sm:{track:`aivex:h-1.5`,thumb:`aivex:h-4 aivex:w-4 aivex:border`},md:{track:`aivex:h-2`,thumb:`aivex:h-6 aivex:w-6 aivex:border-2`}};function s({size:e=`md`,className:s,trackClassName:c,trackRootClassName:l,thumbClassName:u,defaultValue:d=[50],value:f,min:p=0,max:m=100,step:h=1,onValueChange:g,ref:_,...v}){let[y,b]=n.useControllableState({value:f,defaultValue:d,onChange:g}),x=(0,r.useMemo)(()=>{let e=m-p||1;return[...y].sort((e,t)=>e-t).map(t=>(t-p)/e*100)},[y,p,m]),S=(0,r.useMemo)(()=>{let e=[0,...x,100];return e.slice(0,-1).map((t,n)=>({left:t,width:e[n+1]-t}))},[x]);return(0,i.jsxs)(a.Root,{ref:_,className:t.cn(`aivex:relative aivex:flex aivex:w-full aivex:touch-none aivex:select-none aivex:items-center aivex:outline-none`,`aivex:data-[disabled]:pointer-events-none aivex:data-[disabled]:opacity-disable`,s),defaultValue:d,value:f,min:p,max:m,step:h,onValueChange:b,...v,children:[(0,i.jsx)(a.Track,{className:t.cn(`aivex:relative aivex:w-full aivex:grow aivex:overflow-hidden aivex:rounded-full aivex:bg-bg-tertiary`,o[e].track,l),children:S.map(({left:e,width:n},r)=>{let a=r===+(x.length>=2)?`aivex:bg-bg-brand`:`aivex:bg-bg-tertiary`;return(0,i.jsx)(`div`,{className:t.cn(`aivex:absolute aivex:top-0 aivex:h-full aivex:rounded-full`,typeof c==`string`?c:c?.(r)??a),style:{left:`${e}%`,width:`${n}%`}},r)})}),y.map((n,r)=>(0,i.jsx)(a.Thumb,{className:t.cn(`aivex:z-10 aivex:block aivex:box-border aivex:rounded-full aivex:border-border-brand aivex:bg-bg-primary aivex:shadow-sm`,o[e].thumb,`aivex:cursor-pointer aivex:transition-transform aivex:hover:scale-110`,`aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand`,`aivex:disabled:pointer-events-none`,typeof u==`string`?u:u?.(r))},r))]})}exports.Slider=s;
|
|
2
2
|
//# sourceMappingURL=Slider.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../utils.js";
|
|
3
3
|
import { useControllableState as t } from "../../utils/useControllableState.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useMemo as n } from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
import * as a from "@radix-ui/react-slider";
|
|
7
7
|
//#region src/components/Slider/Slider.tsx
|
|
8
8
|
var o = {
|
|
@@ -20,14 +20,14 @@ function s({ size: s = "md", className: c, trackClassName: l, trackRootClassName
|
|
|
20
20
|
value: p,
|
|
21
21
|
defaultValue: f,
|
|
22
22
|
onChange: _
|
|
23
|
-
}), S =
|
|
23
|
+
}), S = n(() => {
|
|
24
24
|
let e = h - m || 1;
|
|
25
25
|
return [...b].sort((e, t) => e - t).map((t) => (t - m) / e * 100);
|
|
26
26
|
}, [
|
|
27
27
|
b,
|
|
28
28
|
m,
|
|
29
29
|
h
|
|
30
|
-
]), C =
|
|
30
|
+
]), C = n(() => {
|
|
31
31
|
let e = [
|
|
32
32
|
0,
|
|
33
33
|
...S,
|
|
@@ -38,7 +38,7 @@ function s({ size: s = "md", className: c, trackClassName: l, trackRootClassName
|
|
|
38
38
|
width: e[n + 1] - t
|
|
39
39
|
}));
|
|
40
40
|
}, [S]);
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ i(a.Root, {
|
|
42
42
|
ref: v,
|
|
43
43
|
className: e("aivex:relative aivex:flex aivex:w-full aivex:touch-none aivex:select-none aivex:items-center aivex:outline-none", "aivex:data-[disabled]:pointer-events-none aivex:data-[disabled]:opacity-disable", c),
|
|
44
44
|
defaultValue: f,
|
|
@@ -48,19 +48,19 @@ function s({ size: s = "md", className: c, trackClassName: l, trackRootClassName
|
|
|
48
48
|
step: g,
|
|
49
49
|
onValueChange: x,
|
|
50
50
|
...y,
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ r(a.Track, {
|
|
52
52
|
className: e("aivex:relative aivex:w-full aivex:grow aivex:overflow-hidden aivex:rounded-full aivex:bg-bg-tertiary", o[s].track, u),
|
|
53
|
-
children: C.map(({ left: t, width:
|
|
53
|
+
children: C.map(({ left: t, width: n }, i) => {
|
|
54
54
|
let a = i === +(S.length >= 2) ? "aivex:bg-bg-brand" : "aivex:bg-bg-tertiary";
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ r("div", {
|
|
56
56
|
className: e("aivex:absolute aivex:top-0 aivex:h-full aivex:rounded-full", typeof l == "string" ? l : l?.(i) ?? a),
|
|
57
57
|
style: {
|
|
58
58
|
left: `${t}%`,
|
|
59
|
-
width: `${
|
|
59
|
+
width: `${n}%`
|
|
60
60
|
}
|
|
61
61
|
}, i);
|
|
62
62
|
})
|
|
63
|
-
}), b.map((t,
|
|
63
|
+
}), b.map((t, n) => /* @__PURE__ */ r(a.Thumb, { className: e("aivex:z-10 aivex:block aivex:box-border aivex:rounded-full aivex:border-border-brand aivex:bg-bg-primary aivex:shadow-sm", o[s].thumb, "aivex:cursor-pointer aivex:transition-transform aivex:hover:scale-110", "aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand", "aivex:disabled:pointer-events-none", typeof d == "string" ? d : d?.(n)) }, n))]
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`);let n=require(`class-variance-authority`),r=require(`react
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`);let n=require(`class-variance-authority`),r=require(`react`),i=require(`react/jsx-runtime`),a=require(`@radix-ui/react-switch`);a=e.__toESM(a,1);var o=(0,n.cva)(`aivex:relative aivex:inline-flex aivex:shrink-0 aivex:items-center aivex:rounded-full aivex:transition-colors aivex:duration-200 aivex:cursor-pointer aivex:bg-bg-tertiary aivex:data-[state=checked]:bg-bg-brand aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:disabled:cursor-not-allowed aivex:disabled:opacity-disable`,{variants:{size:{sm:`aivex:w-6 aivex:h-4`,md:`aivex:w-8 aivex:h-5`,lg:`aivex:w-10 aivex:h-6`}},defaultVariants:{size:`md`}}),s={sm:`aivex:w-2.5 aivex:h-2.5 aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[11px]`,md:`aivex:w-3.5 aivex:h-3.5 aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[15px]`,lg:`aivex:w-[18px] aivex:h-[18px] aivex:translate-x-[3px] aivex:data-[state=checked]:translate-x-[19px]`},c={sm:`aivex:h-4`,md:`aivex:h-5`,lg:`aivex:h-6`};function l({className:e,label:n,size:l=`md`,disabled:u,id:d,ref:f,...p}){let m=l??`md`,h=(0,r.useId)(),g=d??h;return(0,i.jsxs)(`span`,{className:t.cn(`aivex:inline-flex aivex:items-center aivex:gap-md`,u&&`aivex:opacity-disable`),children:[(0,i.jsx)(a.Root,{ref:f,id:g,disabled:u,className:t.cn(o({size:m}),e),...p,children:(0,i.jsx)(a.Thumb,{className:t.cn(`aivex:block aivex:rounded-full aivex:bg-static-white aivex:shadow-[var(--aivex-elevation-sm)] aivex:transition-transform aivex:duration-200 aivex:will-change-transform`,s[m])})}),n&&(0,i.jsx)(`label`,{htmlFor:g,className:t.cn(`aivex:inline-flex aivex:items-center aivex:cursor-pointer aivex:select-none aivex:text-label-lg aivex:text-text-primary`,u&&`aivex:cursor-not-allowed`,c[m]),children:n})]})}exports.Switch=l;
|
|
2
2
|
//# sourceMappingURL=Switch.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../utils.js";
|
|
3
3
|
import { cva as t } from "class-variance-authority";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useId as n } from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
import * as a from "@radix-ui/react-switch";
|
|
7
7
|
//#region src/components/Switch/Switch.tsx
|
|
8
8
|
var o = t("aivex:relative aivex:inline-flex aivex:shrink-0 aivex:items-center aivex:rounded-full aivex:transition-colors aivex:duration-200 aivex:cursor-pointer aivex:bg-bg-tertiary aivex:data-[state=checked]:bg-bg-brand aivex:focus-visible:outline-none aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand aivex:disabled:cursor-not-allowed aivex:disabled:opacity-disable", {
|
|
@@ -22,17 +22,17 @@ var o = t("aivex:relative aivex:inline-flex aivex:shrink-0 aivex:items-center ai
|
|
|
22
22
|
lg: "aivex:h-6"
|
|
23
23
|
};
|
|
24
24
|
function l({ className: t, label: l, size: u = "md", disabled: d, id: f, ref: p, ...m }) {
|
|
25
|
-
let h = u ?? "md", g =
|
|
26
|
-
return /* @__PURE__ */
|
|
25
|
+
let h = u ?? "md", g = n(), _ = f ?? g;
|
|
26
|
+
return /* @__PURE__ */ i("span", {
|
|
27
27
|
className: e("aivex:inline-flex aivex:items-center aivex:gap-md", d && "aivex:opacity-disable"),
|
|
28
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ r(a.Root, {
|
|
29
29
|
ref: p,
|
|
30
30
|
id: _,
|
|
31
31
|
disabled: d,
|
|
32
32
|
className: e(o({ size: h }), t),
|
|
33
33
|
...m,
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
-
}), l && /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ r(a.Thumb, { className: e("aivex:block aivex:rounded-full aivex:bg-static-white aivex:shadow-[var(--aivex-elevation-sm)] aivex:transition-transform aivex:duration-200 aivex:will-change-transform", s[h]) })
|
|
35
|
+
}), l && /* @__PURE__ */ r("label", {
|
|
36
36
|
htmlFor: _,
|
|
37
37
|
className: e("aivex:inline-flex aivex:items-center aivex:cursor-pointer aivex:select-none aivex:text-label-lg aivex:text-text-primary", d && "aivex:cursor-not-allowed", c[h]),
|
|
38
38
|
children: l
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../InputBase/useInputState.cjs`),n=require(`../../utils/useControllableState.cjs`),r=require(`../Tag/Tag.cjs`),i=require(`../InputBase/InputBase.cjs`);let a=require(`react
|
|
1
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../InputBase/useInputState.cjs`),n=require(`../../utils/useControllableState.cjs`),r=require(`../Tag/Tag.cjs`),i=require(`../InputBase/InputBase.cjs`);let a=require(`react`),o=require(`react/jsx-runtime`);function s({className:s,size:c=`sm`,error:l,disabled:u,readOnly:d,value:f,defaultValue:p=[],onValueChange:m,parsePaste:h,validate:g,renderTag:_,placeholder:v,id:y,ref:b,onBlur:x,onCompositionEnd:S,onCompositionStart:C,onFocus:w,onKeyDown:T,onPaste:E,...D}){let[O,k]=n.useControllableState({value:f,defaultValue:p,onChange:m}),[A,j]=(0,a.useState)(``),M=(0,a.useRef)(!1),N=t.useInputFocus({onFocus:w,onBlur:x}),P=N.focused&&!d,F=g?O.some(e=>!g(e)):!1,I=t.resolveInputError(l,D[`aria-invalid`])||F,L=e=>{let t=e.trim();t&&(k([...O,t]),j(``))},R=e=>{k(O.filter((t,n)=>n!==e))},z=e=>{if(T?.(e),!e.defaultPrevented&&!d)if(e.key===`Enter`){if(M.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;e.preventDefault(),A&&L(A)}else e.key===`Backspace`&&!A&&O.length>0&&R(O.length-1)},B=e=>{if(E?.(e),e.defaultPrevented||d||!h)return;e.preventDefault();let t=h(e.clipboardData.getData(`text`)),n=[...new Set(t)].map(e=>e.trim()).filter(e=>e&&!O.includes(e));n.length>0&&k([...O,...n]),j(``)},V=O.map((e,t)=>{let n=()=>R(t),i=g?g(e)?`default`:`error`:I?`error`:`default`;return _?(0,o.jsx)(a.Fragment,{children:_(e,t,{remove:n,size:c,disabled:u,variant:i})},`${e}-${t}`):(0,o.jsx)(r.Tag,{size:c===`md`?`md`:`sm`,variant:i,disabled:u,onRemove:n,children:e},`${e}-${t}`)}),H=(0,o.jsx)(`input`,{ref:b,id:y,value:A,disabled:u,readOnly:d,placeholder:O.length===0?v:void 0,onChange:e=>{d||j(e.target.value)},onKeyDown:z,onPaste:B,onCompositionStart:e=>{M.current=!0,C?.(e)},onCompositionEnd:e=>{M.current=!1,d||j(e.currentTarget.value),S?.(e)},onFocus:N.onFocus,onBlur:e=>{N.onBlur(e),!d&&!M.current&&A&&L(A)},className:e.cn(`aivex:bg-transparent aivex:outline-none aivex:text-text-primary aivex:placeholder:text-text-tertiary aivex:min-w-[80px] aivex:flex-1`,d&&`aivex:cursor-default`,c===`sm`?`aivex:text-body-md-regular aivex:h-6`:`aivex:text-body-lg-regular aivex:h-8`),...D});return(0,o.jsxs)(i.InputBase,{error:I,disabled:u,focused:P,size:c,layout:`wrap`,className:e.cn(s,d&&`aivex:cursor-default`),children:[V,H]})}exports.Tagbox=s;
|
|
2
2
|
//# sourceMappingURL=Tagbox.cjs.map
|
|
@@ -4,15 +4,15 @@ import { resolveInputError as t, useInputFocus as n } from "../InputBase/useInpu
|
|
|
4
4
|
import { useControllableState as r } from "../../utils/useControllableState.js";
|
|
5
5
|
import { Tag as i } from "../Tag/Tag.js";
|
|
6
6
|
import { InputBase as a } from "../InputBase/InputBase.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Fragment as o, useRef as s, useState as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/Tagbox/Tagbox.tsx
|
|
10
10
|
function d({ className: d, size: f = "sm", error: p, disabled: m, readOnly: h, value: g, defaultValue: _ = [], onValueChange: v, parsePaste: y, validate: b, renderTag: x, placeholder: S, id: C, ref: w, onBlur: T, onCompositionEnd: E, onCompositionStart: D, onFocus: O, onKeyDown: k, onPaste: A, ...j }) {
|
|
11
11
|
let [M, N] = r({
|
|
12
12
|
value: g,
|
|
13
13
|
defaultValue: _,
|
|
14
14
|
onChange: v
|
|
15
|
-
}), [P, F] =
|
|
15
|
+
}), [P, F] = c(""), I = s(!1), L = n({
|
|
16
16
|
onFocus: O,
|
|
17
17
|
onBlur: T
|
|
18
18
|
}), R = L.focused && !h, z = b ? M.some((e) => !b(e)) : !1, B = t(p, j["aria-invalid"]) || z, V = (e) => {
|
|
@@ -32,19 +32,19 @@ function d({ className: d, size: f = "sm", error: p, disabled: m, readOnly: h, v
|
|
|
32
32
|
n.length > 0 && N([...M, ...n]), F("");
|
|
33
33
|
}, G = M.map((e, t) => {
|
|
34
34
|
let n = () => H(t), r = b ? b(e) ? "default" : "error" : B ? "error" : "default";
|
|
35
|
-
return x ? /* @__PURE__ */ o
|
|
35
|
+
return x ? /* @__PURE__ */ l(o, { children: x(e, t, {
|
|
36
36
|
remove: n,
|
|
37
37
|
size: f,
|
|
38
38
|
disabled: m,
|
|
39
39
|
variant: r
|
|
40
|
-
}) }, `${e}-${t}`) : /* @__PURE__ */
|
|
40
|
+
}) }, `${e}-${t}`) : /* @__PURE__ */ l(i, {
|
|
41
41
|
size: f === "md" ? "md" : "sm",
|
|
42
42
|
variant: r,
|
|
43
43
|
disabled: m,
|
|
44
44
|
onRemove: n,
|
|
45
45
|
children: e
|
|
46
46
|
}, `${e}-${t}`);
|
|
47
|
-
}), K = /* @__PURE__ */
|
|
47
|
+
}), K = /* @__PURE__ */ l("input", {
|
|
48
48
|
ref: w,
|
|
49
49
|
id: C,
|
|
50
50
|
value: P,
|
|
@@ -69,7 +69,7 @@ function d({ className: d, size: f = "sm", error: p, disabled: m, readOnly: h, v
|
|
|
69
69
|
className: e("aivex:bg-transparent aivex:outline-none aivex:text-text-primary aivex:placeholder:text-text-tertiary aivex:min-w-[80px] aivex:flex-1", h && "aivex:cursor-default", f === "sm" ? "aivex:text-body-md-regular aivex:h-6" : "aivex:text-body-lg-regular aivex:h-8"),
|
|
70
70
|
...j
|
|
71
71
|
});
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ u(a, {
|
|
73
73
|
error: B,
|
|
74
74
|
disabled: m,
|
|
75
75
|
focused: R,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../InputBase/useInputState.cjs`),n=require(`../InputBase/InputBase.cjs`);let r=require(`react
|
|
1
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../InputBase/useInputState.cjs`),n=require(`../InputBase/InputBase.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`);function a({className:a,error:o,disabled:s,size:c=`md`,minHeight:l,fixedHeight:u,startContent:d,endContent:f,id:p,ref:m,onFocus:h,onBlur:g,maxCount:_,value:v,defaultValue:y,onChange:b,...x}){let S=t.useInputFocus({onFocus:h,onBlur:g}),C=_!=null,w=e=>e==null?0:String(e).length,[T,E]=(0,r.useState)(()=>w(v??y)),D=v==null?T:w(v),O=t.resolveInputError(o,x[`aria-invalid`])||C&&D>_,k=e=>{E(e.target.value.length),b?.(e)},A={};l!==void 0&&(A.minHeight=typeof l==`number`?`${l}px`:l),u&&l!==void 0&&(A.height=A.minHeight,A.maxHeight=A.minHeight);let j=(0,i.jsx)(`textarea`,{ref:m,id:p,disabled:s,style:A,value:v,defaultValue:y,className:e.cn(`aivex:w-full aivex:min-w-0 aivex:bg-transparent aivex:text-text-primary aivex:placeholder:text-text-tertiary aivex:outline-none`,c===`sm`?`aivex:text-body-md-regular`:`aivex:text-body-lg-regular`,`aivex:resize-none aivex:overflow-auto`,a),onChange:C?k:b,onFocus:S.onFocus,onBlur:S.onBlur,...x});return(0,i.jsx)(n.InputBase,{error:O,disabled:s,focused:S.focused,size:c,layout:`block`,startContent:d,endContent:f,children:C?(0,i.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:flex-col aivex:gap-xs`,children:[j,(0,i.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-2xs aivex:text-body-sm-regular aivex:whitespace-nowrap`,children:[(0,i.jsx)(`span`,{className:O?`aivex:text-text-danger`:`aivex:text-text-tertiary`,children:D}),(0,i.jsx)(`span`,{className:`aivex:text-text-tertiary`,children:`/ ${_}`})]})]}):j})}exports.Textarea=a;
|
|
2
2
|
//# sourceMappingURL=Textarea.cjs.map
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { cn as e } from "../../utils.js";
|
|
3
3
|
import { resolveInputError as t, useInputFocus as n } from "../InputBase/useInputState.js";
|
|
4
4
|
import { InputBase as r } from "../InputBase/InputBase.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useState as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/Textarea/Textarea.tsx
|
|
8
8
|
function s({ className: s, error: c, disabled: l, size: u = "md", minHeight: d, fixedHeight: f, startContent: p, endContent: m, id: h, ref: g, onFocus: _, onBlur: v, maxCount: y, value: b, defaultValue: x, onChange: S, ...C }) {
|
|
9
9
|
let w = n({
|
|
10
10
|
onFocus: _,
|
|
11
11
|
onBlur: v
|
|
12
|
-
}), T = y != null, E = (e) => e == null ? 0 : String(e).length, [D, O] =
|
|
12
|
+
}), T = y != null, E = (e) => e == null ? 0 : String(e).length, [D, O] = i(() => E(b ?? x)), k = b == null ? D : E(b), A = t(c, C["aria-invalid"]) || T && k > y, j = (e) => {
|
|
13
13
|
O(e.target.value.length), S?.(e);
|
|
14
14
|
}, M = {};
|
|
15
15
|
d !== void 0 && (M.minHeight = typeof d == "number" ? `${d}px` : d), f && d !== void 0 && (M.height = M.minHeight, M.maxHeight = M.minHeight);
|
|
16
|
-
let N = /* @__PURE__ */
|
|
16
|
+
let N = /* @__PURE__ */ a("textarea", {
|
|
17
17
|
ref: g,
|
|
18
18
|
id: h,
|
|
19
19
|
disabled: l,
|
|
@@ -26,7 +26,7 @@ function s({ className: s, error: c, disabled: l, size: u = "md", minHeight: d,
|
|
|
26
26
|
onBlur: w.onBlur,
|
|
27
27
|
...C
|
|
28
28
|
});
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ a(r, {
|
|
30
30
|
error: A,
|
|
31
31
|
disabled: l,
|
|
32
32
|
focused: w.focused,
|
|
@@ -34,14 +34,14 @@ function s({ className: s, error: c, disabled: l, size: u = "md", minHeight: d,
|
|
|
34
34
|
layout: "block",
|
|
35
35
|
startContent: p,
|
|
36
36
|
endContent: m,
|
|
37
|
-
children: T ? /* @__PURE__ */
|
|
37
|
+
children: T ? /* @__PURE__ */ o("div", {
|
|
38
38
|
className: "aivex:flex aivex:w-full aivex:flex-col aivex:gap-xs",
|
|
39
|
-
children: [N, /* @__PURE__ */
|
|
39
|
+
children: [N, /* @__PURE__ */ o("div", {
|
|
40
40
|
className: "aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-2xs aivex:text-body-sm-regular aivex:whitespace-nowrap",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ a("span", {
|
|
42
42
|
className: A ? "aivex:text-text-danger" : "aivex:text-text-tertiary",
|
|
43
43
|
children: k
|
|
44
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ a("span", {
|
|
45
45
|
className: "aivex:text-text-tertiary",
|
|
46
46
|
children: `/ ${y}`
|
|
47
47
|
})]
|
|
@@ -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`),i=require(`../IconButton/IconButton.cjs`),a=require(`../InputBase/InputBase.cjs`);let o=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`),i=require(`../IconButton/IconButton.cjs`),a=require(`../InputBase/InputBase.cjs`);let o=require(`react`),s=require(`react/jsx-runtime`),c=require(`@radix-ui/react-compose-refs`);function l({className:l,error:u,disabled:d,clearable:f,clearAriaLabel:p=`입력값 삭제`,startContent:m,endContent:h,size:g=`md`,id:_,ref:v,value:y,defaultValue:b,onValueChange:x,onChange:S,onFocus:C,onBlur:w,...T}){let E=n.useInputFocus({onFocus:C,onBlur:w}),D=(0,o.useRef)(null),O=y!==void 0,[k,A]=r.useControllableState({value:O?String(y??``):void 0,defaultValue:typeof b==`string`?b:b?.toString()??``,onChange:x}),j=f&&k.length>0,M=e=>{A(e.target.value),S?.(e)},N=(0,c.useComposedRefs)(v,D),P=(0,s.jsxs)(s.Fragment,{children:[h,j&&(0,s.jsx)(i.IconButton,{size:g===`sm`?`xs`:`sm`,onClick:()=>{A(``),D.current?.focus()},onMouseDown:e=>e.preventDefault(),tabIndex:-1,className:`aivex:shrink-0`,"aria-label":p,children:(0,s.jsx)(t.CloseIcon,{size:g===`sm`?14:16})})]}),F=h||j;return(0,s.jsx)(a.InputBase,{error:n.resolveInputError(u,T[`aria-invalid`]),disabled:d,focused:E.focused,filled:k.length>0,size:g,layout:`inline`,startContent:m,endContent:F?P:void 0,children:(0,s.jsx)(`input`,{ref:N,id:_,disabled:d,value:f?k:y,defaultValue:f?void 0:b,onChange:f||O||x?M:S,className:e.cn(`aivex:m-0 aivex:w-full aivex:min-w-0 aivex:appearance-none aivex:border-0 aivex:bg-transparent aivex:p-0 aivex:text-text-primary aivex:placeholder:text-text-tertiary aivex:outline-none`,g===`sm`?`aivex:text-body-md-regular`:`aivex:text-body-lg-regular`,l),onFocus:E.onFocus,onBlur:E.onBlur,...T})})}exports.Textbox=l;
|
|
2
2
|
//# sourceMappingURL=Textbox.cjs.map
|
|
@@ -5,21 +5,21 @@ import { resolveInputError as n, useInputFocus as r } from "../InputBase/useInpu
|
|
|
5
5
|
import { useControllableState as i } from "../../utils/useControllableState.js";
|
|
6
6
|
import { IconButton as a } from "../IconButton/IconButton.js";
|
|
7
7
|
import { InputBase as o } from "../InputBase/InputBase.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useRef as s } from "react";
|
|
9
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
import { useComposedRefs as d } from "@radix-ui/react-compose-refs";
|
|
11
11
|
//#region src/components/Textbox/Textbox.tsx
|
|
12
12
|
function f({ className: f, error: p, disabled: m, clearable: h, clearAriaLabel: g = "입력값 삭제", startContent: _, endContent: v, size: y = "md", id: b, ref: x, value: S, defaultValue: C, onValueChange: w, onChange: T, onFocus: E, onBlur: D, ...O }) {
|
|
13
13
|
let k = r({
|
|
14
14
|
onFocus: E,
|
|
15
15
|
onBlur: D
|
|
16
|
-
}), A =
|
|
16
|
+
}), A = s(null), j = S !== void 0, [M, N] = i({
|
|
17
17
|
value: j ? String(S ?? "") : void 0,
|
|
18
18
|
defaultValue: typeof C == "string" ? C : C?.toString() ?? "",
|
|
19
19
|
onChange: w
|
|
20
20
|
}), P = h && M.length > 0, F = (e) => {
|
|
21
21
|
N(e.target.value), T?.(e);
|
|
22
|
-
}, I = d(x, A), L = /* @__PURE__ */
|
|
22
|
+
}, I = d(x, A), L = /* @__PURE__ */ u(c, { children: [v, P && /* @__PURE__ */ l(a, {
|
|
23
23
|
size: y === "sm" ? "xs" : "sm",
|
|
24
24
|
onClick: () => {
|
|
25
25
|
N(""), A.current?.focus();
|
|
@@ -28,9 +28,9 @@ function f({ className: f, error: p, disabled: m, clearable: h, clearAriaLabel:
|
|
|
28
28
|
tabIndex: -1,
|
|
29
29
|
className: "aivex:shrink-0",
|
|
30
30
|
"aria-label": g,
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ l(t, { size: y === "sm" ? 14 : 16 })
|
|
32
32
|
})] }), R = v || P;
|
|
33
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ l(o, {
|
|
34
34
|
error: n(p, O["aria-invalid"]),
|
|
35
35
|
disabled: m,
|
|
36
36
|
focused: k.focused,
|
|
@@ -39,7 +39,7 @@ function f({ className: f, error: p, disabled: m, clearable: h, clearAriaLabel:
|
|
|
39
39
|
layout: "inline",
|
|
40
40
|
startContent: _,
|
|
41
41
|
endContent: R ? L : void 0,
|
|
42
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ l("input", {
|
|
43
43
|
ref: I,
|
|
44
44
|
id: b,
|
|
45
45
|
disabled: m,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../Icon/index.cjs`),n=require(`../Button/Button.cjs`);let r=require(`react
|
|
1
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../Icon/index.cjs`),n=require(`../Button/Button.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`);function a({className:a,formats:o=[`jpg`,`bmp`,`png`,`json`],maxSize:s=`800MB`,accept:c,title:l=`Drag and drop here`,formatsLabel:u=`Formats`,maxSizeLabel:d=`Max size`,fileButtonLabel:f=`File`,folderButtonLabel:p=`Folder`,showFolder:m=!0,onFileSelect:h,onFolderSelect:g,ref:_,...v}){let[y,b]=(0,r.useState)(!1),x=(0,r.useRef)(null),S=(0,r.useRef)(null),C=(0,r.useRef)(0);return(0,i.jsxs)(`div`,{ref:_,className:e.cn(`aivex:flex aivex:flex-col aivex:items-center aivex:justify-center aivex:p-[48px] aivex:rounded-[8px] aivex:border-2 aivex:border-dashed aivex:transition-colors`,y?`aivex:bg-bg-brand-subtle aivex:border-[var(--aivex-brand-primary-200)]`:`aivex:border-border-medium`,a),onDragEnter:e=>{e.preventDefault(),C.current++,b(!0)},onDragLeave:e=>{e.preventDefault(),C.current--,C.current===0&&b(!1)},onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault(),C.current=0,b(!1),e.dataTransfer.files.length>0&&h?.(e.dataTransfer.files)},...v,children:[(0,i.jsxs)(`div`,{className:`aivex:flex aivex:flex-col aivex:items-center aivex:gap-6`,children:[(0,i.jsxs)(`div`,{className:`aivex:flex aivex:flex-col aivex:items-center aivex:gap-3 aivex:pt-3`,children:[(0,i.jsx)(t.ArrowCircleUpFilledIcon,{size:28,color:`var(--aivex-icon-tertiary)`}),(0,i.jsxs)(`div`,{className:`aivex:flex aivex:flex-col aivex:items-center aivex:gap-1`,children:[(0,i.jsx)(`p`,{className:`aivex:text-[18px] aivex:font-medium aivex:text-text-primary aivex:leading-[26px] aivex:tracking-[-0.1px]`,children:l}),(0,i.jsxs)(`div`,{className:`aivex:flex aivex:items-center aivex:gap-3 aivex:px-4 aivex:text-sm aivex:font-normal aivex:text-text-brand`,children:[(0,i.jsxs)(`span`,{children:[u,` : `,o.join(`, `)]}),(0,i.jsxs)(`span`,{children:[d,` : `,s]})]})]})]}),(0,i.jsxs)(`div`,{className:`aivex:flex aivex:gap-2`,children:[(0,i.jsx)(n.Button,{type:`button`,variant:`outline`,color:`secondary`,size:`md`,startContent:(0,i.jsx)(t.FileIcon,{size:16}),onClick:()=>x.current?.click(),children:f}),m&&(0,i.jsx)(n.Button,{type:`button`,variant:`outline`,color:`secondary`,size:`md`,startContent:(0,i.jsx)(t.FolderCloseIcon,{size:16}),onClick:()=>S.current?.click(),children:p})]})]}),(0,i.jsx)(`input`,{ref:x,type:`file`,multiple:!0,accept:c,className:`aivex:hidden`,onChange:e=>e.target.files&&h?.(e.target.files)}),(0,i.jsx)(`input`,{ref:S,type:`file`,multiple:!0,webkitdirectory:``,className:`aivex:hidden`,onChange:e=>e.target.files&&g?.(e.target.files)})]})}exports.UploadArea=a;
|
|
2
2
|
//# sourceMappingURL=UploadArea.cjs.map
|