@aivex/ui 1.2.0-dev.53 → 1.2.0-dev.55
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/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.map +1 -1
- package/dist/components/DataGrid/DataGrid.js +68 -70
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.cjs +1 -1
- package/dist/components/DataGrid/DataGridColumnSettings.js +17 -17
- package/dist/components/DataGrid/DataGridColumnSettings.js.map +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.cjs +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.cjs.map +1 -1
- package/dist/components/DataGrid/DataGridPrimitives.js +60 -62
- package/dist/components/DataGrid/DataGridPrimitives.js.map +1 -1
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +59 -11
- package/dist/components/Drawer/Drawer.js +87 -29
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Overlay/Overlay.cjs.map +1 -1
- package/dist/components/Overlay/Overlay.d.ts +1 -1
- package/dist/components/Overlay/Overlay.js.map +1 -1
- package/dist/components/Panel/Panel.cjs +1 -1
- package/dist/components/Panel/Panel.cjs.map +1 -1
- package/dist/components/Panel/Panel.d.ts +77 -8
- package/dist/components/Panel/Panel.js +83 -46
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/index.d.ts +1 -1
- package/dist/components/TruncatedText/TruncatedText.cjs +2 -0
- package/dist/components/TruncatedText/TruncatedText.cjs.map +1 -0
- package/dist/components/TruncatedText/TruncatedText.d.ts +22 -0
- package/dist/components/TruncatedText/TruncatedText.js +71 -0
- package/dist/components/TruncatedText/TruncatedText.js.map +1 -0
- package/dist/components/TruncatedText/index.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +41 -40
- package/dist/styles.css +1 -1
- package/dist/tokens/tokens.css +1 -1
- package/dist/utils/sheet.cjs +2 -0
- package/dist/utils/sheet.cjs.map +1 -0
- package/dist/utils/sheet.d.ts +17 -0
- package/dist/utils/sheet.js +7 -0
- package/dist/utils/sheet.js.map +1 -0
- package/dist/utils/useResizableWidth.cjs +2 -0
- package/dist/utils/useResizableWidth.cjs.map +1 -0
- package/dist/utils/useResizableWidth.d.ts +30 -0
- package/dist/utils/useResizableWidth.js +32 -0
- package/dist/utils/useResizableWidth.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drawer·Panel이 함께 쓰는 사이드 시트 조각의 모양 — Figma ADS 2.0의 Drawer·Panel
|
|
3
|
+
* (Header 50px·제목 Body1/Medium 18/26·좌우 16px·아래 구분선, Body 사방 16px).
|
|
4
|
+
* 두 컴포넌트는 동작(오버레이 vs 레이아웃)이 달라 조각만 공유한다.
|
|
5
|
+
*/
|
|
6
|
+
/** 시트 기본 폭(px) — Figma 기본값. */
|
|
7
|
+
export declare const SHEET_DEFAULT_WIDTH = 420;
|
|
8
|
+
/** 헤더 줄 — 높이 50px(위아래 11px + 제목 26px + 구분선 1px), 좌우 16px. */
|
|
9
|
+
export declare const sheetHeaderClassName = "aivex:flex aivex:min-h-[50px] aivex:w-full aivex:shrink-0 aivex:items-center aivex:justify-between aivex:gap-md aivex:border-b aivex:border-border-subtle aivex:px-xl aivex:py-[11px]";
|
|
10
|
+
/** 헤더 제목 — Body1/Medium(18px/26px). */
|
|
11
|
+
export declare const sheetTitleClassName = "aivex:m-0 aivex:min-w-0 aivex:truncate aivex:text-heading-xs aivex:text-text-primary";
|
|
12
|
+
/** 헤더 오른쪽 동작 묶음 — 24px 아이콘 버튼을 8px 간격으로 둔다. */
|
|
13
|
+
export declare const sheetActionsClassName = "aivex:flex aivex:shrink-0 aivex:items-center aivex:gap-md";
|
|
14
|
+
/** 남은 높이를 채우고 넘치면 세로 스크롤하는 본문. */
|
|
15
|
+
export declare const sheetBodyClassName = "aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:overflow-y-auto";
|
|
16
|
+
/** 본문 기본 여백 — 사방 16px. */
|
|
17
|
+
export declare const sheetBodyPaddingClassName = "aivex:p-xl";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/utils/sheet.ts
|
|
3
|
+
var e = "aivex:flex aivex:min-h-[50px] aivex:w-full aivex:shrink-0 aivex:items-center aivex:justify-between aivex:gap-md aivex:border-b aivex:border-border-subtle aivex:px-xl aivex:py-[11px]", t = "aivex:m-0 aivex:min-w-0 aivex:truncate aivex:text-heading-xs aivex:text-text-primary", n = "aivex:flex aivex:shrink-0 aivex:items-center aivex:gap-md", r = "aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:overflow-y-auto", i = "aivex:p-xl";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { n as sheetActionsClassName, r as sheetBodyClassName, i as sheetBodyPaddingClassName, e as sheetHeaderClassName, t as sheetTitleClassName };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.js","names":[],"sources":["../../src/utils/sheet.ts"],"sourcesContent":["/**\n * Drawer·Panel이 함께 쓰는 사이드 시트 조각의 모양 — Figma ADS 2.0의 Drawer·Panel\n * (Header 50px·제목 Body1/Medium 18/26·좌우 16px·아래 구분선, Body 사방 16px).\n * 두 컴포넌트는 동작(오버레이 vs 레이아웃)이 달라 조각만 공유한다.\n */\n\n/** 시트 기본 폭(px) — Figma 기본값. */\nexport const SHEET_DEFAULT_WIDTH = 420;\n\n/** 헤더 줄 — 높이 50px(위아래 11px + 제목 26px + 구분선 1px), 좌우 16px. */\nexport const sheetHeaderClassName =\n \"aivex:flex aivex:min-h-[50px] aivex:w-full aivex:shrink-0 aivex:items-center aivex:justify-between aivex:gap-md aivex:border-b aivex:border-border-subtle aivex:px-xl aivex:py-[11px]\";\n\n/** 헤더 제목 — Body1/Medium(18px/26px). */\nexport const sheetTitleClassName =\n \"aivex:m-0 aivex:min-w-0 aivex:truncate aivex:text-heading-xs aivex:text-text-primary\";\n\n/** 헤더 오른쪽 동작 묶음 — 24px 아이콘 버튼을 8px 간격으로 둔다. */\nexport const sheetActionsClassName = \"aivex:flex aivex:shrink-0 aivex:items-center aivex:gap-md\";\n\n/** 남은 높이를 채우고 넘치면 세로 스크롤하는 본문. */\nexport const sheetBodyClassName =\n \"aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:overflow-y-auto\";\n\n/** 본문 기본 여백 — 사방 16px. */\nexport const sheetBodyPaddingClassName = \"aivex:p-xl\";\n"],"mappings":";;AAUA,IAAa,IACX,yLAGW,IACX,wFAGW,IAAwB,6DAGxB,IACX,8EAGW,IAA4B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`react`);var t=16;function n({side:n,minWidth:r,maxWidth:i,viewportGap:a=48}){let[o,s]=(0,e.useState)(null),c=(0,e.useRef)(!1),l=e=>Math.max(r,i??(e.defaultView?.innerWidth??0)-a),u=(e,t)=>Math.round(Math.min(l(t),Math.max(r,e))),d=e=>e.parentElement??e,f=e=>{e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),c.current=!0)},p=e=>{if(!c.current)return;let t=d(e.currentTarget).getBoundingClientRect();s(u(n===`right`?t.right-e.clientX:e.clientX-t.left,e.currentTarget.ownerDocument))},m=e=>{c.current&&(c.current=!1,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return{width:o,handlers:{onPointerDown:f,onPointerMove:p,onPointerUp:m,onPointerCancel:m,onKeyDown:e=>{let i=e.currentTarget.ownerDocument,a=o??d(e.currentTarget).getBoundingClientRect().width,c=e.shiftKey?t*4:t,f=n===`right`?`ArrowLeft`:`ArrowRight`,p=n===`right`?`ArrowRight`:`ArrowLeft`,m=null;e.key===f?m=a+c:e.key===p?m=a-c:e.key===`Home`?m=r:e.key===`End`&&(m=l(i)),m!==null&&(e.preventDefault(),e.stopPropagation(),s(u(m,i)))}}}}exports.useResizableWidth=n;
|
|
2
|
+
//# sourceMappingURL=useResizableWidth.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizableWidth.cjs","names":[],"sources":["../../src/utils/useResizableWidth.ts"],"sourcesContent":["import type { KeyboardEvent, PointerEvent } from \"react\";\nimport { useRef, useState } from \"react\";\n\n/** 키보드 한 번에 바뀌는 폭(px). Shift를 누르면 4배. */\nconst KEYBOARD_STEP = 16;\n\nexport interface ResizableWidthOptions {\n /** 핸들이 붙는 쪽의 반대 — 시트가 붙은 화면 가장자리. right면 핸들은 왼쪽 모서리에 있다. */\n side: \"left\" | \"right\";\n /** 최소 폭(px). */\n minWidth: number;\n /** 최대 폭(px). 생략하면 화면 폭에서 viewportGap을 뺀 값. */\n maxWidth?: number;\n /** maxWidth를 생략했을 때 화면 반대편에 남길 여백(px). */\n viewportGap?: number;\n}\n\n/**\n * 사이드 시트의 바깥쪽 모서리를 끌어 폭을 바꾼다 — 포인터 드래그와 방향키를 모두 받는다.\n * 폭은 핸들의 부모(시트 요소)의 화면 위치를 기준으로 계산하므로 시트가 화면 끝이\n * 아닌 곳(GNB 옆 등)에 붙어 있어도 맞는다. width가 null이면 아직 조절하지 않은 상태다.\n */\nexport function useResizableWidth({\n side,\n minWidth,\n maxWidth,\n viewportGap = 48,\n}: ResizableWidthOptions) {\n const [width, setWidth] = useState<number | null>(null);\n const draggingRef = useRef(false);\n\n const resolveMax = (doc: Document) =>\n Math.max(minWidth, maxWidth ?? (doc.defaultView?.innerWidth ?? 0) - viewportGap);\n const clamp = (value: number, doc: Document) =>\n Math.round(Math.min(resolveMax(doc), Math.max(minWidth, value)));\n\n const sheetOf = (handle: HTMLElement) => handle.parentElement ?? handle;\n\n const onPointerDown = (event: PointerEvent<HTMLElement>) => {\n if (event.button !== 0) return;\n event.preventDefault();\n event.currentTarget.setPointerCapture(event.pointerId);\n draggingRef.current = true;\n };\n\n const onPointerMove = (event: PointerEvent<HTMLElement>) => {\n if (!draggingRef.current) return;\n const rect = sheetOf(event.currentTarget).getBoundingClientRect();\n const next = side === \"right\" ? rect.right - event.clientX : event.clientX - rect.left;\n setWidth(clamp(next, event.currentTarget.ownerDocument));\n };\n\n const endDrag = (event: PointerEvent<HTMLElement>) => {\n if (!draggingRef.current) return;\n draggingRef.current = false;\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n const doc = event.currentTarget.ownerDocument;\n const current = width ?? sheetOf(event.currentTarget).getBoundingClientRect().width;\n const step = event.shiftKey ? KEYBOARD_STEP * 4 : KEYBOARD_STEP;\n // 시트가 오른쪽에 붙어 있으면 왼쪽 화살표가 넓힌다(모서리가 왼쪽으로 간다).\n const grow = side === \"right\" ? \"ArrowLeft\" : \"ArrowRight\";\n const shrink = side === \"right\" ? \"ArrowRight\" : \"ArrowLeft\";\n let next: number | null = null;\n if (event.key === grow) next = current + step;\n else if (event.key === shrink) next = current - step;\n else if (event.key === \"Home\") next = minWidth;\n else if (event.key === \"End\") next = resolveMax(doc);\n if (next === null) return;\n event.preventDefault();\n event.stopPropagation();\n setWidth(clamp(next, doc));\n };\n\n return {\n width,\n /**\n * 핸들 요소에 펼치는 포인터·키보드 핸들러. 핸들에는 role=\"separator\",\n * aria-orientation=\"vertical\", tabIndex={0}, aria-valuenow={width}를 함께 둔다.\n */\n handlers: {\n onPointerDown,\n onPointerMove,\n onPointerUp: endDrag,\n onPointerCancel: endDrag,\n onKeyDown,\n },\n };\n}\n"],"mappings":"iF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AC7B,EAAM,MAAQ,QAAO,EAAO,EAAW,EAAI,EAChD,IAAS,OACb,EAAM,gBAAgB,CACtB,EAAM,iBAAiB,CACvB,EAAS,EAAM,EAAM,EAAI,CAAC,GAezB,CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { KeyboardEvent, PointerEvent } from "react";
|
|
2
|
+
export interface ResizableWidthOptions {
|
|
3
|
+
/** 핸들이 붙는 쪽의 반대 — 시트가 붙은 화면 가장자리. right면 핸들은 왼쪽 모서리에 있다. */
|
|
4
|
+
side: "left" | "right";
|
|
5
|
+
/** 최소 폭(px). */
|
|
6
|
+
minWidth: number;
|
|
7
|
+
/** 최대 폭(px). 생략하면 화면 폭에서 viewportGap을 뺀 값. */
|
|
8
|
+
maxWidth?: number;
|
|
9
|
+
/** maxWidth를 생략했을 때 화면 반대편에 남길 여백(px). */
|
|
10
|
+
viewportGap?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 사이드 시트의 바깥쪽 모서리를 끌어 폭을 바꾼다 — 포인터 드래그와 방향키를 모두 받는다.
|
|
14
|
+
* 폭은 핸들의 부모(시트 요소)의 화면 위치를 기준으로 계산하므로 시트가 화면 끝이
|
|
15
|
+
* 아닌 곳(GNB 옆 등)에 붙어 있어도 맞는다. width가 null이면 아직 조절하지 않은 상태다.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useResizableWidth({ side, minWidth, maxWidth, viewportGap, }: ResizableWidthOptions): {
|
|
18
|
+
width: number | null;
|
|
19
|
+
/**
|
|
20
|
+
* 핸들 요소에 펼치는 포인터·키보드 핸들러. 핸들에는 role="separator",
|
|
21
|
+
* aria-orientation="vertical", tabIndex={0}, aria-valuenow={width}를 함께 둔다.
|
|
22
|
+
*/
|
|
23
|
+
handlers: {
|
|
24
|
+
onPointerDown: (event: PointerEvent<HTMLElement>) => void;
|
|
25
|
+
onPointerMove: (event: PointerEvent<HTMLElement>) => void;
|
|
26
|
+
onPointerUp: (event: PointerEvent<HTMLElement>) => void;
|
|
27
|
+
onPointerCancel: (event: PointerEvent<HTMLElement>) => void;
|
|
28
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as e, useState as t } from "react";
|
|
3
|
+
//#region src/utils/useResizableWidth.ts
|
|
4
|
+
var n = 16;
|
|
5
|
+
function r({ side: r, minWidth: i, maxWidth: a, viewportGap: o = 48 }) {
|
|
6
|
+
let [s, c] = t(null), l = e(!1), u = (e) => Math.max(i, a ?? (e.defaultView?.innerWidth ?? 0) - o), d = (e, t) => Math.round(Math.min(u(t), Math.max(i, e))), f = (e) => e.parentElement ?? e, p = (e) => {
|
|
7
|
+
e.button === 0 && (e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), l.current = !0);
|
|
8
|
+
}, m = (e) => {
|
|
9
|
+
if (!l.current) return;
|
|
10
|
+
let t = f(e.currentTarget).getBoundingClientRect();
|
|
11
|
+
c(d(r === "right" ? t.right - e.clientX : e.clientX - t.left, e.currentTarget.ownerDocument));
|
|
12
|
+
}, h = (e) => {
|
|
13
|
+
l.current && (l.current = !1, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
width: s,
|
|
17
|
+
handlers: {
|
|
18
|
+
onPointerDown: p,
|
|
19
|
+
onPointerMove: m,
|
|
20
|
+
onPointerUp: h,
|
|
21
|
+
onPointerCancel: h,
|
|
22
|
+
onKeyDown: (e) => {
|
|
23
|
+
let t = e.currentTarget.ownerDocument, a = s ?? f(e.currentTarget).getBoundingClientRect().width, o = e.shiftKey ? n * 4 : n, l = r === "right" ? "ArrowLeft" : "ArrowRight", p = r === "right" ? "ArrowRight" : "ArrowLeft", m = null;
|
|
24
|
+
e.key === l ? m = a + o : e.key === p ? m = a - o : e.key === "Home" ? m = i : e.key === "End" && (m = u(t)), m !== null && (e.preventDefault(), e.stopPropagation(), c(d(m, t)));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { r as useResizableWidth };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=useResizableWidth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizableWidth.js","names":[],"sources":["../../src/utils/useResizableWidth.ts"],"sourcesContent":["import type { KeyboardEvent, PointerEvent } from \"react\";\nimport { useRef, useState } from \"react\";\n\n/** 키보드 한 번에 바뀌는 폭(px). Shift를 누르면 4배. */\nconst KEYBOARD_STEP = 16;\n\nexport interface ResizableWidthOptions {\n /** 핸들이 붙는 쪽의 반대 — 시트가 붙은 화면 가장자리. right면 핸들은 왼쪽 모서리에 있다. */\n side: \"left\" | \"right\";\n /** 최소 폭(px). */\n minWidth: number;\n /** 최대 폭(px). 생략하면 화면 폭에서 viewportGap을 뺀 값. */\n maxWidth?: number;\n /** maxWidth를 생략했을 때 화면 반대편에 남길 여백(px). */\n viewportGap?: number;\n}\n\n/**\n * 사이드 시트의 바깥쪽 모서리를 끌어 폭을 바꾼다 — 포인터 드래그와 방향키를 모두 받는다.\n * 폭은 핸들의 부모(시트 요소)의 화면 위치를 기준으로 계산하므로 시트가 화면 끝이\n * 아닌 곳(GNB 옆 등)에 붙어 있어도 맞는다. width가 null이면 아직 조절하지 않은 상태다.\n */\nexport function useResizableWidth({\n side,\n minWidth,\n maxWidth,\n viewportGap = 48,\n}: ResizableWidthOptions) {\n const [width, setWidth] = useState<number | null>(null);\n const draggingRef = useRef(false);\n\n const resolveMax = (doc: Document) =>\n Math.max(minWidth, maxWidth ?? (doc.defaultView?.innerWidth ?? 0) - viewportGap);\n const clamp = (value: number, doc: Document) =>\n Math.round(Math.min(resolveMax(doc), Math.max(minWidth, value)));\n\n const sheetOf = (handle: HTMLElement) => handle.parentElement ?? handle;\n\n const onPointerDown = (event: PointerEvent<HTMLElement>) => {\n if (event.button !== 0) return;\n event.preventDefault();\n event.currentTarget.setPointerCapture(event.pointerId);\n draggingRef.current = true;\n };\n\n const onPointerMove = (event: PointerEvent<HTMLElement>) => {\n if (!draggingRef.current) return;\n const rect = sheetOf(event.currentTarget).getBoundingClientRect();\n const next = side === \"right\" ? rect.right - event.clientX : event.clientX - rect.left;\n setWidth(clamp(next, event.currentTarget.ownerDocument));\n };\n\n const endDrag = (event: PointerEvent<HTMLElement>) => {\n if (!draggingRef.current) return;\n draggingRef.current = false;\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n const doc = event.currentTarget.ownerDocument;\n const current = width ?? sheetOf(event.currentTarget).getBoundingClientRect().width;\n const step = event.shiftKey ? KEYBOARD_STEP * 4 : KEYBOARD_STEP;\n // 시트가 오른쪽에 붙어 있으면 왼쪽 화살표가 넓힌다(모서리가 왼쪽으로 간다).\n const grow = side === \"right\" ? \"ArrowLeft\" : \"ArrowRight\";\n const shrink = side === \"right\" ? \"ArrowRight\" : \"ArrowLeft\";\n let next: number | null = null;\n if (event.key === grow) next = current + step;\n else if (event.key === shrink) next = current - step;\n else if (event.key === \"Home\") next = minWidth;\n else if (event.key === \"End\") next = resolveMax(doc);\n if (next === null) return;\n event.preventDefault();\n event.stopPropagation();\n setWidth(clamp(next, doc));\n };\n\n return {\n width,\n /**\n * 핸들 요소에 펼치는 포인터·키보드 핸들러. 핸들에는 role=\"separator\",\n * aria-orientation=\"vertical\", tabIndex={0}, aria-valuenow={width}를 함께 둔다.\n */\n handlers: {\n onPointerDown,\n onPointerMove,\n onPointerUp: endDrag,\n onPointerCancel: endDrag,\n onKeyDown,\n },\n };\n}\n"],"mappings":";;;AAIA,IAAM,IAAgB;AAkBtB,SAAgB,EAAkB,EAChC,SACA,aACA,aACA,iBAAc,MACU;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AiB,EACvB,EAAS,EAAM,GAAM,EAAI,CAAC;;GAezB;EACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aivex/ui",
|
|
3
|
-
"version": "1.2.0-dev.
|
|
3
|
+
"version": "1.2.0-dev.55",
|
|
4
4
|
"description": "Aivex Design System UI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -240,6 +240,7 @@
|
|
|
240
240
|
"@radix-ui/react-dialog": "1.1.15",
|
|
241
241
|
"@radix-ui/react-dropdown-menu": "2.1.16",
|
|
242
242
|
"@radix-ui/react-popover": "1.1.15",
|
|
243
|
+
"@radix-ui/react-popper": "1.2.8",
|
|
243
244
|
"@radix-ui/react-scroll-area": "^1.2.18",
|
|
244
245
|
"@radix-ui/react-select": "2.2.6",
|
|
245
246
|
"@radix-ui/react-slider": "^1.4.7",
|