@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.
Files changed (63) hide show
  1. package/dist/components/Avatar/Avatar.cjs +1 -1
  2. package/dist/components/Avatar/Avatar.cjs.map +1 -1
  3. package/dist/components/Avatar/Avatar.d.ts +2 -4
  4. package/dist/components/Avatar/Avatar.js +31 -29
  5. package/dist/components/Avatar/Avatar.js.map +1 -1
  6. package/dist/components/Calendar/Calendar.cjs +1 -1
  7. package/dist/components/Calendar/Calendar.js +25 -25
  8. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  9. package/dist/components/Checkbox/Checkbox.js +10 -10
  10. package/dist/components/Comment/MentionInput.cjs +1 -1
  11. package/dist/components/Comment/MentionInput.js +8 -8
  12. package/dist/components/Comment/MentionList.cjs +1 -1
  13. package/dist/components/Comment/MentionList.js +36 -36
  14. package/dist/components/DataGrid/DataGrid.cjs +1 -1
  15. package/dist/components/DataGrid/DataGrid.js +108 -108
  16. package/dist/components/DataGrid/DataGrid.js.map +1 -1
  17. package/dist/components/DataGrid/DataGridColumnSettings.cjs +1 -1
  18. package/dist/components/DataGrid/DataGridColumnSettings.js +36 -36
  19. package/dist/components/DataGrid/DataGridPrimitives.cjs +1 -1
  20. package/dist/components/DataGrid/DataGridPrimitives.js +48 -48
  21. package/dist/components/DataGrid/DataGridRows.cjs +1 -1
  22. package/dist/components/DataGrid/DataGridRows.js +24 -24
  23. package/dist/components/DraggableScroll/DraggableScroll.cjs +1 -1
  24. package/dist/components/DraggableScroll/DraggableScroll.js +5 -5
  25. package/dist/components/Field/Field.cjs +1 -1
  26. package/dist/components/Field/Field.js +34 -34
  27. package/dist/components/FilterModal/FilterModal.cjs +1 -1
  28. package/dist/components/FilterModal/FilterModal.js +24 -24
  29. package/dist/components/Modal/Modal.cjs +1 -1
  30. package/dist/components/Modal/Modal.js +51 -51
  31. package/dist/components/Pagination/Pagination.cjs +1 -1
  32. package/dist/components/Pagination/Pagination.js +24 -24
  33. package/dist/components/Radio/Radio.cjs +1 -1
  34. package/dist/components/Radio/Radio.js +9 -9
  35. package/dist/components/Segmented/Segmented.cjs +1 -1
  36. package/dist/components/Segmented/Segmented.js +12 -12
  37. package/dist/components/SelectBox/SelectBox.cjs +1 -1
  38. package/dist/components/SelectBox/SelectBox.js +12 -12
  39. package/dist/components/ShapeEditor/ShapeEditor.cjs +1 -1
  40. package/dist/components/ShapeEditor/ShapeEditor.js +367 -367
  41. package/dist/components/ShapeEditor/ShapeEditor.js.map +1 -1
  42. package/dist/components/ShapeEditor/ShapeViewer.cjs +1 -1
  43. package/dist/components/ShapeEditor/ShapeViewer.js +17 -17
  44. package/dist/components/ShapeEditor/_components/CursorGuide.cjs +1 -1
  45. package/dist/components/ShapeEditor/_components/CursorGuide.js +7 -7
  46. package/dist/components/ShapeEditor/_components/Minimap.cjs +1 -1
  47. package/dist/components/ShapeEditor/_components/Minimap.js +29 -29
  48. package/dist/components/ShapeEditor/_components/MinimapShape.cjs +1 -1
  49. package/dist/components/ShapeEditor/_components/MinimapShape.cjs.map +1 -1
  50. package/dist/components/ShapeEditor/_components/MinimapShape.js +9 -9
  51. package/dist/components/Slider/Slider.cjs +1 -1
  52. package/dist/components/Slider/Slider.js +10 -10
  53. package/dist/components/Switch/Switch.cjs +1 -1
  54. package/dist/components/Switch/Switch.js +7 -7
  55. package/dist/components/Tagbox/Tagbox.cjs +1 -1
  56. package/dist/components/Tagbox/Tagbox.js +7 -7
  57. package/dist/components/Textarea/Textarea.cjs +1 -1
  58. package/dist/components/Textarea/Textarea.js +9 -9
  59. package/dist/components/Textbox/Textbox.cjs +1 -1
  60. package/dist/components/Textbox/Textbox.js +7 -7
  61. package/dist/components/UploadArea/UploadArea.cjs +1 -1
  62. package/dist/components/UploadArea/UploadArea.js +19 -19
  63. package/package.json +1 -1
@@ -2,13 +2,13 @@
2
2
  "use client";
3
3
  import { cn as e } from "../../utils.js";
4
4
  import { cva as t } from "class-variance-authority";
5
- import { jsx as n } from "react/jsx-runtime";
6
- import { createContext as r, useContext as i, useId as a } from "react";
5
+ import { createContext as n, useContext as r, useId as i } from "react";
6
+ import { jsx as a } from "react/jsx-runtime";
7
7
  import { Slot as o } from "@radix-ui/react-slot";
8
8
  //#region src/components/Field/Field.tsx
9
- var s = r(null);
9
+ var s = n(null);
10
10
  function c() {
11
- let e = i(s);
11
+ let e = r(s);
12
12
  if (!e) throw Error("Field 하위 컴포넌트는 <Field> 내부에서 사용해야 합니다.");
13
13
  return e;
14
14
  }
@@ -19,69 +19,69 @@ var l = t("aivex:flex aivex:w-full", {
19
19
  } },
20
20
  defaultVariants: { orientation: "vertical" }
21
21
  });
22
- function u({ className: t, orientation: r, fieldId: i, invalid: o = !1, disabled: c = !1, ref: u, ...d }) {
23
- let f = a(), p = i ?? f, m = {
22
+ function u({ className: t, orientation: n, fieldId: r, invalid: o = !1, disabled: c = !1, ref: u, ...d }) {
23
+ let f = i(), p = r ?? f, m = {
24
24
  controlId: p,
25
25
  descriptionId: `${p}-description`,
26
26
  errorId: `${p}-error`,
27
27
  invalid: o,
28
28
  disabled: c
29
29
  };
30
- return /* @__PURE__ */ n(s.Provider, {
30
+ return /* @__PURE__ */ a(s.Provider, {
31
31
  value: m,
32
- children: /* @__PURE__ */ n("div", {
32
+ children: /* @__PURE__ */ a("div", {
33
33
  ref: u,
34
- className: e(l({ orientation: r }), t),
34
+ className: e(l({ orientation: n }), t),
35
35
  "data-invalid": o || void 0,
36
36
  "data-disabled": c || void 0,
37
37
  ...d
38
38
  })
39
39
  });
40
40
  }
41
- function d({ className: t, ref: r, ...i }) {
42
- let { controlId: a, invalid: o, disabled: s } = c();
43
- return /* @__PURE__ */ n("label", {
44
- ref: r,
45
- htmlFor: a,
41
+ function d({ className: t, ref: n, ...r }) {
42
+ let { controlId: i, invalid: o, disabled: s } = c();
43
+ return /* @__PURE__ */ a("label", {
44
+ ref: n,
45
+ htmlFor: i,
46
46
  className: e("aivex:text-label-md aivex:text-text-secondary aivex:cursor-pointer aivex:select-none", s && "aivex:cursor-not-allowed aivex:text-text-disabled", !s && o && "aivex:text-text-danger", t),
47
- ...i
47
+ ...r
48
48
  });
49
49
  }
50
- function f({ className: t, ref: r, ...i }) {
51
- return /* @__PURE__ */ n("div", {
52
- ref: r,
50
+ function f({ className: t, ref: n, ...r }) {
51
+ return /* @__PURE__ */ a("div", {
52
+ ref: n,
53
53
  "data-slot": "field-content",
54
54
  className: e("aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:gap-2xs", t),
55
- ...i
55
+ ...r
56
56
  });
57
57
  }
58
58
  function p({ children: e }) {
59
- let { controlId: t, descriptionId: r, errorId: i, invalid: a } = c();
60
- return /* @__PURE__ */ n(o, {
59
+ let { controlId: t, descriptionId: n, errorId: r, invalid: i } = c();
60
+ return /* @__PURE__ */ a(o, {
61
61
  id: t,
62
- "aria-describedby": a ? `${r} ${i}` : r,
63
- "aria-invalid": a || void 0,
62
+ "aria-describedby": i ? `${n} ${r}` : n,
63
+ "aria-invalid": i || void 0,
64
64
  children: e
65
65
  });
66
66
  }
67
- function m({ className: t, ref: r, ...i }) {
68
- let { descriptionId: a, disabled: o } = c();
69
- return /* @__PURE__ */ n("p", {
70
- ref: r,
71
- id: a,
67
+ function m({ className: t, ref: n, ...r }) {
68
+ let { descriptionId: i, disabled: o } = c();
69
+ return /* @__PURE__ */ a("p", {
70
+ ref: n,
71
+ id: i,
72
72
  className: e("aivex:text-caption-md aivex:text-text-secondary", o && "aivex:text-text-disabled", t),
73
- ...i
73
+ ...r
74
74
  });
75
75
  }
76
- function h({ className: t, children: r, ref: i, ...a }) {
76
+ function h({ className: t, children: n, ref: r, ...i }) {
77
77
  let { errorId: o, invalid: s } = c();
78
- return !s && !r ? null : /* @__PURE__ */ n("p", {
79
- ref: i,
78
+ return !s && !n ? null : /* @__PURE__ */ a("p", {
79
+ ref: r,
80
80
  id: o,
81
81
  role: "alert",
82
82
  className: e("aivex:text-caption-md aivex:text-text-danger", t),
83
- ...a,
84
- children: r
83
+ ...i,
84
+ children: n
85
85
  });
86
86
  }
87
87
  //#endregion
@@ -1,2 +1,2 @@
1
- "use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../DraggableScroll/DraggableScroll.cjs`),t=require(`../Modal/Modal.cjs`),n=require(`../Tag/Tag.cjs`),r=require(`../ToggleButton/ToggleButton.cjs`);let i=require(`react/jsx-runtime`),a=require(`react`);var o=`linear-gradient(to bottom, #000 calc(100% - 24px), transparent)`,s=(0,a.memo)(function({open:s,onClose:c,onApply:l,options:u,values:d,title:f,clearLabel:p,applyLabel:m,emptyText:h}){let[g,_]=(0,a.useState)(d),v=(0,a.useRef)(null),[y,b]=(0,a.useState)(!1),x=(0,a.useCallback)(()=>{let e=v.current;e&&b(e.scrollTop+e.clientHeight<e.scrollHeight-1)},[]),S=({groupValue:e,optionValue:t})=>u.find(t=>t.groupValue===e)?.options.find(e=>e.value===t),C=g.map(e=>{let t=S(e);return{key:`${e.groupValue}-${e.optionValue}`,label:t?.label??e.optionValue,icon:t?.icon,value:e}}),w=(0,a.useCallback)(({groupValue:e,optionValue:t})=>{_(n=>n.some(n=>n.groupValue===e&&n.optionValue===t)?n.filter(n=>!(n.groupValue===e&&n.optionValue===t)):[...n,{groupValue:e,optionValue:t}])},[]),T=(0,a.useCallback)(()=>{_([])},[]),E=(0,a.useCallback)(()=>{l(g),c()},[g,l,c]),D=(0,a.useCallback)(({groupValue:e,optionValue:t})=>{_(n=>n.filter(n=>!(n.groupValue===e&&n.optionValue===t)))},[]);return(0,a.useEffect)(()=>{_(d)},[d,s]),(0,a.useEffect)(()=>{x()},[g,u,s,x]),(0,i.jsx)(t.Modal,{open:s,onOpenChange:e=>{e||c()},title:f,size:`md`,tertiaryButton:{children:p,onClick:T},primaryButton:{children:m,onClick:E},children:(0,i.jsxs)(`div`,{className:`aivex:flex aivex:flex-col aivex:gap-2xl`,style:{height:480},children:[(0,i.jsx)(`div`,{ref:v,onScroll:x,className:`aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:gap-2xl aivex:overflow-y-auto`,style:y?{maskImage:o,WebkitMaskImage:o}:void 0,children:u.map(e=>(0,i.jsx)(`div`,{className:`aivex:flex aivex:flex-col`,children:(0,i.jsxs)(`div`,{className:`aivex:flex aivex:flex-col aivex:gap-md`,children:[(0,i.jsx)(`div`,{className:`aivex:text-label-md aivex:text-text-secondary`,children:e.groupLabel}),e.options.length>0?(0,i.jsx)(`div`,{className:`aivex:flex aivex:flex-wrap aivex:gap-md`,children:e.options.map(t=>(0,i.jsx)(r.ToggleButton,{active:g.some(n=>n.groupValue===e.groupValue&&n.optionValue===t.value),shape:`rounded`,size:`md`,startContent:t.icon,onClick:()=>w({groupValue:e.groupValue,optionValue:t.value}),className:`aivex:max-w-full`,children:t.label},t.value))}):(0,i.jsx)(`div`,{className:`aivex:text-body-sm-regular aivex:text-text-tertiary`,children:h})]})},e.groupValue))}),g.length>0&&(0,i.jsx)(e.DraggableScroll,{autoScrollToEnd:!0,className:`aivex:shrink-0`,children:(0,i.jsx)(`div`,{className:`aivex:flex aivex:gap-md`,children:C.map(e=>(0,i.jsx)(n.Tag,{size:`md`,startContent:e.icon,onRemove:()=>D(e.value),className:`aivex:shrink-0`,children:e.label},e.key))})})]})})});exports.FilterModal=s;
1
+ "use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../DraggableScroll/DraggableScroll.cjs`),t=require(`../Modal/Modal.cjs`),n=require(`../Tag/Tag.cjs`),r=require(`../ToggleButton/ToggleButton.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`);var o=`linear-gradient(to bottom, #000 calc(100% - 24px), transparent)`,s=(0,i.memo)(function({open:s,onClose:c,onApply:l,options:u,values:d,title:f,clearLabel:p,applyLabel:m,emptyText:h}){let[g,_]=(0,i.useState)(d),v=(0,i.useRef)(null),[y,b]=(0,i.useState)(!1),x=(0,i.useCallback)(()=>{let e=v.current;e&&b(e.scrollTop+e.clientHeight<e.scrollHeight-1)},[]),S=({groupValue:e,optionValue:t})=>u.find(t=>t.groupValue===e)?.options.find(e=>e.value===t),C=g.map(e=>{let t=S(e);return{key:`${e.groupValue}-${e.optionValue}`,label:t?.label??e.optionValue,icon:t?.icon,value:e}}),w=(0,i.useCallback)(({groupValue:e,optionValue:t})=>{_(n=>n.some(n=>n.groupValue===e&&n.optionValue===t)?n.filter(n=>!(n.groupValue===e&&n.optionValue===t)):[...n,{groupValue:e,optionValue:t}])},[]),T=(0,i.useCallback)(()=>{_([])},[]),E=(0,i.useCallback)(()=>{l(g),c()},[g,l,c]),D=(0,i.useCallback)(({groupValue:e,optionValue:t})=>{_(n=>n.filter(n=>!(n.groupValue===e&&n.optionValue===t)))},[]);return(0,i.useEffect)(()=>{_(d)},[d,s]),(0,i.useEffect)(()=>{x()},[g,u,s,x]),(0,a.jsx)(t.Modal,{open:s,onOpenChange:e=>{e||c()},title:f,size:`md`,tertiaryButton:{children:p,onClick:T},primaryButton:{children:m,onClick:E},children:(0,a.jsxs)(`div`,{className:`aivex:flex aivex:flex-col aivex:gap-2xl`,style:{height:480},children:[(0,a.jsx)(`div`,{ref:v,onScroll:x,className:`aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:gap-2xl aivex:overflow-y-auto`,style:y?{maskImage:o,WebkitMaskImage:o}:void 0,children:u.map(e=>(0,a.jsx)(`div`,{className:`aivex:flex aivex:flex-col`,children:(0,a.jsxs)(`div`,{className:`aivex:flex aivex:flex-col aivex:gap-md`,children:[(0,a.jsx)(`div`,{className:`aivex:text-label-md aivex:text-text-secondary`,children:e.groupLabel}),e.options.length>0?(0,a.jsx)(`div`,{className:`aivex:flex aivex:flex-wrap aivex:gap-md`,children:e.options.map(t=>(0,a.jsx)(r.ToggleButton,{active:g.some(n=>n.groupValue===e.groupValue&&n.optionValue===t.value),shape:`rounded`,size:`md`,startContent:t.icon,onClick:()=>w({groupValue:e.groupValue,optionValue:t.value}),className:`aivex:max-w-full`,children:t.label},t.value))}):(0,a.jsx)(`div`,{className:`aivex:text-body-sm-regular aivex:text-text-tertiary`,children:h})]})},e.groupValue))}),g.length>0&&(0,a.jsx)(e.DraggableScroll,{autoScrollToEnd:!0,className:`aivex:shrink-0`,children:(0,a.jsx)(`div`,{className:`aivex:flex aivex:gap-md`,children:C.map(e=>(0,a.jsx)(n.Tag,{size:`md`,startContent:e.icon,onRemove:()=>D(e.value),className:`aivex:shrink-0`,children:e.label},e.key))})})]})})});exports.FilterModal=s;
2
2
  //# sourceMappingURL=FilterModal.cjs.map
@@ -3,11 +3,11 @@ import { DraggableScroll as e } from "../DraggableScroll/DraggableScroll.js";
3
3
  import { Modal as t } from "../Modal/Modal.js";
4
4
  import { Tag as n } from "../Tag/Tag.js";
5
5
  import { ToggleButton as r } from "../ToggleButton/ToggleButton.js";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { memo as o, useCallback as s, useEffect as c, useRef as l, useState as u } from "react";
6
+ import { memo as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  //#region src/components/FilterModal/FilterModal.tsx
9
- var d = "linear-gradient(to bottom, #000 calc(100% - 24px), transparent)", f = o(function({ open: o, onClose: f, onApply: p, options: m, values: h, title: g, clearLabel: _, applyLabel: v, emptyText: y }) {
10
- let [b, x] = u(h), S = l(null), [C, w] = u(!1), T = s(() => {
9
+ var d = "linear-gradient(to bottom, #000 calc(100% - 24px), transparent)", f = i(function({ open: i, onClose: f, onApply: p, options: m, values: h, title: g, clearLabel: _, applyLabel: v, emptyText: y }) {
10
+ let [b, x] = c(h), S = s(null), [C, w] = c(!1), T = a(() => {
11
11
  let e = S.current;
12
12
  e && w(e.scrollTop + e.clientHeight < e.scrollHeight - 1);
13
13
  }, []), E = ({ groupValue: e, optionValue: t }) => m.find((t) => t.groupValue === e)?.options.find((e) => e.value === t), D = b.map((e) => {
@@ -18,33 +18,33 @@ var d = "linear-gradient(to bottom, #000 calc(100% - 24px), transparent)", f = o
18
18
  icon: t?.icon,
19
19
  value: e
20
20
  };
21
- }), O = s(({ groupValue: e, optionValue: t }) => {
21
+ }), O = a(({ groupValue: e, optionValue: t }) => {
22
22
  x((n) => n.some((n) => n.groupValue === e && n.optionValue === t) ? n.filter((n) => !(n.groupValue === e && n.optionValue === t)) : [...n, {
23
23
  groupValue: e,
24
24
  optionValue: t
25
25
  }]);
26
- }, []), k = s(() => {
26
+ }, []), k = a(() => {
27
27
  x([]);
28
- }, []), A = s(() => {
28
+ }, []), A = a(() => {
29
29
  p(b), f();
30
30
  }, [
31
31
  b,
32
32
  p,
33
33
  f
34
- ]), j = s(({ groupValue: e, optionValue: t }) => {
34
+ ]), j = a(({ groupValue: e, optionValue: t }) => {
35
35
  x((n) => n.filter((n) => !(n.groupValue === e && n.optionValue === t)));
36
36
  }, []);
37
- return c(() => {
37
+ return o(() => {
38
38
  x(h);
39
- }, [h, o]), c(() => {
39
+ }, [h, i]), o(() => {
40
40
  T();
41
41
  }, [
42
42
  b,
43
43
  m,
44
- o,
44
+ i,
45
45
  T
46
- ]), /* @__PURE__ */ i(t, {
47
- open: o,
46
+ ]), /* @__PURE__ */ l(t, {
47
+ open: i,
48
48
  onOpenChange: (e) => {
49
49
  e || f();
50
50
  },
@@ -58,10 +58,10 @@ var d = "linear-gradient(to bottom, #000 calc(100% - 24px), transparent)", f = o
58
58
  children: v,
59
59
  onClick: A
60
60
  },
61
- children: /* @__PURE__ */ a("div", {
61
+ children: /* @__PURE__ */ u("div", {
62
62
  className: "aivex:flex aivex:flex-col aivex:gap-2xl",
63
63
  style: { height: 480 },
64
- children: [/* @__PURE__ */ i("div", {
64
+ children: [/* @__PURE__ */ l("div", {
65
65
  ref: S,
66
66
  onScroll: T,
67
67
  className: "aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:gap-2xl aivex:overflow-y-auto",
@@ -69,16 +69,16 @@ var d = "linear-gradient(to bottom, #000 calc(100% - 24px), transparent)", f = o
69
69
  maskImage: d,
70
70
  WebkitMaskImage: d
71
71
  } : void 0,
72
- children: m.map((e) => /* @__PURE__ */ i("div", {
72
+ children: m.map((e) => /* @__PURE__ */ l("div", {
73
73
  className: "aivex:flex aivex:flex-col",
74
- children: /* @__PURE__ */ a("div", {
74
+ children: /* @__PURE__ */ u("div", {
75
75
  className: "aivex:flex aivex:flex-col aivex:gap-md",
76
- children: [/* @__PURE__ */ i("div", {
76
+ children: [/* @__PURE__ */ l("div", {
77
77
  className: "aivex:text-label-md aivex:text-text-secondary",
78
78
  children: e.groupLabel
79
- }), e.options.length > 0 ? /* @__PURE__ */ i("div", {
79
+ }), e.options.length > 0 ? /* @__PURE__ */ l("div", {
80
80
  className: "aivex:flex aivex:flex-wrap aivex:gap-md",
81
- children: e.options.map((t) => /* @__PURE__ */ i(r, {
81
+ children: e.options.map((t) => /* @__PURE__ */ l(r, {
82
82
  active: b.some((n) => n.groupValue === e.groupValue && n.optionValue === t.value),
83
83
  shape: "rounded",
84
84
  size: "md",
@@ -90,18 +90,18 @@ var d = "linear-gradient(to bottom, #000 calc(100% - 24px), transparent)", f = o
90
90
  className: "aivex:max-w-full",
91
91
  children: t.label
92
92
  }, t.value))
93
- }) : /* @__PURE__ */ i("div", {
93
+ }) : /* @__PURE__ */ l("div", {
94
94
  className: "aivex:text-body-sm-regular aivex:text-text-tertiary",
95
95
  children: y
96
96
  })]
97
97
  })
98
98
  }, e.groupValue))
99
- }), b.length > 0 && /* @__PURE__ */ i(e, {
99
+ }), b.length > 0 && /* @__PURE__ */ l(e, {
100
100
  autoScrollToEnd: !0,
101
101
  className: "aivex:shrink-0",
102
- children: /* @__PURE__ */ i("div", {
102
+ children: /* @__PURE__ */ l("div", {
103
103
  className: "aivex:flex aivex:gap-md",
104
- children: D.map((e) => /* @__PURE__ */ i(n, {
104
+ children: D.map((e) => /* @__PURE__ */ l(n, {
105
105
  size: "md",
106
106
  startContent: e.icon,
107
107
  onRemove: () => j(e.value),
@@ -1,2 +1,2 @@
1
- "use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`),n=require(`../Icon/index.cjs`),r=require(`../Button/Button.cjs`),i=require(`../IconButton/IconButton.cjs`),a=require(`../Overlay/Overlay.cjs`),o=require(`../../utils/useModalAutoFocus.cjs`);let s=require(`react/jsx-runtime`),c=require(`react`),l=require(`@radix-ui/react-dialog`);l=e.__toESM(l,1);var u=(0,c.createContext)(!1),d={sm:`aivex:max-w-modal-sm`,md:`aivex:max-w-modal-md`,lg:`aivex:max-w-modal-lg`,xl:`aivex:max-w-[960px]`,full:`aivex:h-[calc(100dvh-32px)] aivex:max-w-[calc(100vw-32px)]`},f=t.cn(`aivex:flex aivex:max-h-[80dvh] aivex:w-[85vw] aivex:flex-col aivex:gap-2xl aivex:overflow-hidden aivex:p-2xl`,`aivex:rounded-2xl aivex:border aivex:border-border-subtle aivex:bg-bg-primary aivex:shadow-xl aivex:outline-none`),p=`aivex:flex aivex:w-full aivex:flex-col aivex:gap-xs`;function m({title:e,titleId:t,description:r,headingButton:a,onClose:o,closeAriaLabel:d=`Close modal`,ref:f,...m}){let g=(0,c.useContext)(u),_=(0,s.jsx)(`h2`,{...t?{id:t}:{},className:`aivex:m-0 aivex:whitespace-pre-line aivex:text-heading-xs aivex:text-text-primary aivex:break-words`,children:e}),v=r?(0,s.jsx)(`p`,{className:`aivex:m-0 aivex:whitespace-pre-line aivex:text-body-md-regular aivex:text-text-secondary aivex:break-words`,children:r}):null,y=(0,s.jsx)(i.IconButton,{size:`md`,onClick:o,className:`aivex:shrink-0`,"aria-label":d,children:(0,s.jsx)(n.CloseIcon,{size:24})}),b=a?(0,s.jsx)(h,{button:a}):null;return(0,s.jsxs)(`div`,{ref:f,className:p,...m,children:[(0,s.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:items-center aivex:justify-center aivex:gap-md`,children:[b,(0,s.jsx)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:justify-center`,children:g?(0,s.jsx)(l.Title,{asChild:!0,children:_}):_}),o?y:g&&(0,s.jsx)(l.Close,{asChild:!0,children:y})]}),g&&v?(0,s.jsx)(l.Description,{asChild:!0,children:v}):v]})}function h({button:e}){let{children:t,...n}=e;return(0,s.jsx)(i.IconButton,{size:`md`,className:`aivex:shrink-0`,...n,children:t})}function g({children:e,ref:t,...n}){return(0,s.jsx)(`div`,{ref:t,"data-aivex-modal-body":``,className:`aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:overflow-y-auto`,...n,children:e})}function _({tertiaryButton:e,secondaryButton:t,primaryButton:n,ref:r,...i}){return(0,s.jsxs)(`div`,{ref:r,className:`aivex:flex aivex:h-10 aivex:w-full aivex:items-center aivex:justify-end aivex:gap-lg`,...i,children:[(0,s.jsx)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:items-center aivex:justify-start`,children:e&&(0,s.jsx)(v,{button:e,variant:`ghost`,color:`secondary`,className:`aivex:min-w-9`})}),(0,s.jsxs)(`div`,{className:`aivex:flex aivex:shrink-0 aivex:items-center aivex:justify-end aivex:gap-lg`,children:[t&&(0,s.jsx)(v,{button:t,variant:`solid`,color:`secondary`,className:`aivex:min-w-[84px]`}),n&&(0,s.jsx)(v,{button:n,variant:`solid`,color:`primary`,className:`aivex:min-w-[84px]`})]})]})}function v({button:e,variant:t,color:n,className:i}){let{children:a,...o}=e;return(0,s.jsx)(r.Button,{variant:t,color:n,size:`lg`,className:i,...o,children:a})}function y({open:e,defaultOpen:n,onOpenChange:r,children:i,size:c=`md`,closeOnInteractOutside:p=!0,onOpenAutoFocus:m,onCloseAutoFocus:h,onInteractOutside:g,onKeyDown:_,onKeyUp:v,ref:y,...b}){let x=o.useModalAutoFocus(m,h);return(0,s.jsx)(l.Root,{open:e,defaultOpen:n,onOpenChange:r,children:(0,s.jsxs)(l.Portal,{children:[(0,s.jsx)(l.Overlay,{className:a.overlayVariants({variant:`dim`})}),(0,s.jsx)(l.Content,{ref:y,className:t.cn(`aivex:fixed aivex:left-1/2 aivex:top-1/2 aivex:z-(--aivex-z-modal)`,`aivex:-translate-x-1/2 aivex:-translate-y-1/2`,f,d[c]),onInteractOutside:e=>{g?.(e),!p&&!e.defaultPrevented&&e.preventDefault()},...x,onKeyDown:_,onKeyUp:v,...b,children:(0,s.jsx)(u.Provider,{value:!0,children:i})})]})})}function b({title:e,description:n,headingButton:r,children:i,tertiaryButton:a,secondaryButton:o,primaryButton:l,size:u=`md`,onClose:p,closeAriaLabel:h,ref:v}){let y=(0,c.useId)(),b=!!(a||o||l);return(0,s.jsxs)(`div`,{ref:v,role:`dialog`,"aria-modal":`true`,"aria-labelledby":y,className:t.cn(f,d[u]),children:[(0,s.jsx)(m,{title:e,titleId:y,description:n,headingButton:r,onClose:p,closeAriaLabel:h}),i&&(0,s.jsx)(g,{children:i}),b&&(0,s.jsx)(_,{tertiaryButton:a,secondaryButton:o,primaryButton:l})]})}function x({open:e,defaultOpen:t,onOpenChange:n,title:r,description:i,headingButton:a,children:o,tertiaryButton:c,secondaryButton:l,primaryButton:u,size:d,closeOnInteractOutside:f,onOpenAutoFocus:p,closeAriaLabel:h}){let v=!!(c||l||u);return(0,s.jsxs)(y,{open:e,defaultOpen:t,onOpenChange:n,size:d,closeOnInteractOutside:f,onOpenAutoFocus:p,...i?{}:{"aria-describedby":void 0},children:[(0,s.jsx)(m,{title:r,description:i,headingButton:a,closeAriaLabel:h}),o&&(0,s.jsx)(g,{children:o}),v&&(0,s.jsx)(_,{tertiaryButton:c,secondaryButton:l,primaryButton:u})]})}exports.Modal=x,exports.ModalSurface=b;
1
+ "use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`),n=require(`../Icon/index.cjs`),r=require(`../Button/Button.cjs`),i=require(`../IconButton/IconButton.cjs`),a=require(`../Overlay/Overlay.cjs`),o=require(`../../utils/useModalAutoFocus.cjs`);let s=require(`react`),c=require(`react/jsx-runtime`),l=require(`@radix-ui/react-dialog`);l=e.__toESM(l,1);var u=(0,s.createContext)(!1),d={sm:`aivex:max-w-modal-sm`,md:`aivex:max-w-modal-md`,lg:`aivex:max-w-modal-lg`,xl:`aivex:max-w-[960px]`,full:`aivex:h-[calc(100dvh-32px)] aivex:max-w-[calc(100vw-32px)]`},f=t.cn(`aivex:flex aivex:max-h-[80dvh] aivex:w-[85vw] aivex:flex-col aivex:gap-2xl aivex:overflow-hidden aivex:p-2xl`,`aivex:rounded-2xl aivex:border aivex:border-border-subtle aivex:bg-bg-primary aivex:shadow-xl aivex:outline-none`),p=`aivex:flex aivex:w-full aivex:flex-col aivex:gap-xs`;function m({title:e,titleId:t,description:r,headingButton:a,onClose:o,closeAriaLabel:d=`Close modal`,ref:f,...m}){let g=(0,s.useContext)(u),_=(0,c.jsx)(`h2`,{...t?{id:t}:{},className:`aivex:m-0 aivex:whitespace-pre-line aivex:text-heading-xs aivex:text-text-primary aivex:break-words`,children:e}),v=r?(0,c.jsx)(`p`,{className:`aivex:m-0 aivex:whitespace-pre-line aivex:text-body-md-regular aivex:text-text-secondary aivex:break-words`,children:r}):null,y=(0,c.jsx)(i.IconButton,{size:`md`,onClick:o,className:`aivex:shrink-0`,"aria-label":d,children:(0,c.jsx)(n.CloseIcon,{size:24})}),b=a?(0,c.jsx)(h,{button:a}):null;return(0,c.jsxs)(`div`,{ref:f,className:p,...m,children:[(0,c.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:items-center aivex:justify-center aivex:gap-md`,children:[b,(0,c.jsx)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:justify-center`,children:g?(0,c.jsx)(l.Title,{asChild:!0,children:_}):_}),o?y:g&&(0,c.jsx)(l.Close,{asChild:!0,children:y})]}),g&&v?(0,c.jsx)(l.Description,{asChild:!0,children:v}):v]})}function h({button:e}){let{children:t,...n}=e;return(0,c.jsx)(i.IconButton,{size:`md`,className:`aivex:shrink-0`,...n,children:t})}function g({children:e,ref:t,...n}){return(0,c.jsx)(`div`,{ref:t,"data-aivex-modal-body":``,className:`aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:overflow-y-auto`,...n,children:e})}function _({tertiaryButton:e,secondaryButton:t,primaryButton:n,ref:r,...i}){return(0,c.jsxs)(`div`,{ref:r,className:`aivex:flex aivex:h-10 aivex:w-full aivex:items-center aivex:justify-end aivex:gap-lg`,...i,children:[(0,c.jsx)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:items-center aivex:justify-start`,children:e&&(0,c.jsx)(v,{button:e,variant:`ghost`,color:`secondary`,className:`aivex:min-w-9`})}),(0,c.jsxs)(`div`,{className:`aivex:flex aivex:shrink-0 aivex:items-center aivex:justify-end aivex:gap-lg`,children:[t&&(0,c.jsx)(v,{button:t,variant:`solid`,color:`secondary`,className:`aivex:min-w-[84px]`}),n&&(0,c.jsx)(v,{button:n,variant:`solid`,color:`primary`,className:`aivex:min-w-[84px]`})]})]})}function v({button:e,variant:t,color:n,className:i}){let{children:a,...o}=e;return(0,c.jsx)(r.Button,{variant:t,color:n,size:`lg`,className:i,...o,children:a})}function y({open:e,defaultOpen:n,onOpenChange:r,children:i,size:s=`md`,closeOnInteractOutside:p=!0,onOpenAutoFocus:m,onCloseAutoFocus:h,onInteractOutside:g,onKeyDown:_,onKeyUp:v,ref:y,...b}){let x=o.useModalAutoFocus(m,h);return(0,c.jsx)(l.Root,{open:e,defaultOpen:n,onOpenChange:r,children:(0,c.jsxs)(l.Portal,{children:[(0,c.jsx)(l.Overlay,{className:a.overlayVariants({variant:`dim`})}),(0,c.jsx)(l.Content,{ref:y,className:t.cn(`aivex:fixed aivex:left-1/2 aivex:top-1/2 aivex:z-(--aivex-z-modal)`,`aivex:-translate-x-1/2 aivex:-translate-y-1/2`,f,d[s]),onInteractOutside:e=>{g?.(e),!p&&!e.defaultPrevented&&e.preventDefault()},...x,onKeyDown:_,onKeyUp:v,...b,children:(0,c.jsx)(u.Provider,{value:!0,children:i})})]})})}function b({title:e,description:n,headingButton:r,children:i,tertiaryButton:a,secondaryButton:o,primaryButton:l,size:u=`md`,onClose:p,closeAriaLabel:h,ref:v}){let y=(0,s.useId)(),b=!!(a||o||l);return(0,c.jsxs)(`div`,{ref:v,role:`dialog`,"aria-modal":`true`,"aria-labelledby":y,className:t.cn(f,d[u]),children:[(0,c.jsx)(m,{title:e,titleId:y,description:n,headingButton:r,onClose:p,closeAriaLabel:h}),i&&(0,c.jsx)(g,{children:i}),b&&(0,c.jsx)(_,{tertiaryButton:a,secondaryButton:o,primaryButton:l})]})}function x({open:e,defaultOpen:t,onOpenChange:n,title:r,description:i,headingButton:a,children:o,tertiaryButton:s,secondaryButton:l,primaryButton:u,size:d,closeOnInteractOutside:f,onOpenAutoFocus:p,closeAriaLabel:h}){let v=!!(s||l||u);return(0,c.jsxs)(y,{open:e,defaultOpen:t,onOpenChange:n,size:d,closeOnInteractOutside:f,onOpenAutoFocus:p,...i?{}:{"aria-describedby":void 0},children:[(0,c.jsx)(m,{title:r,description:i,headingButton:a,closeAriaLabel:h}),o&&(0,c.jsx)(g,{children:o}),v&&(0,c.jsx)(_,{tertiaryButton:s,secondaryButton:l,primaryButton:u})]})}exports.Modal=x,exports.ModalSurface=b;
2
2
  //# sourceMappingURL=Modal.cjs.map
@@ -5,53 +5,53 @@ import { Button as n } from "../Button/Button.js";
5
5
  import { IconButton as r } from "../IconButton/IconButton.js";
6
6
  import { overlayVariants as i } from "../Overlay/Overlay.js";
7
7
  import { useModalAutoFocus as a } from "../../utils/useModalAutoFocus.js";
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
- import { createContext as c, useContext as l, useId as u } from "react";
8
+ import { createContext as o, useContext as s, useId as c } from "react";
9
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
10
  import * as d from "@radix-ui/react-dialog";
11
11
  //#region src/components/Modal/Modal.tsx
12
- var f = c(!1), p = {
12
+ var f = o(!1), p = {
13
13
  sm: "aivex:max-w-modal-sm",
14
14
  md: "aivex:max-w-modal-md",
15
15
  lg: "aivex:max-w-modal-lg",
16
16
  xl: "aivex:max-w-[960px]",
17
17
  full: "aivex:h-[calc(100dvh-32px)] aivex:max-w-[calc(100vw-32px)]"
18
18
  }, m = e("aivex:flex aivex:max-h-[80dvh] aivex:w-[85vw] aivex:flex-col aivex:gap-2xl aivex:overflow-hidden aivex:p-2xl", "aivex:rounded-2xl aivex:border aivex:border-border-subtle aivex:bg-bg-primary aivex:shadow-xl aivex:outline-none"), h = "aivex:flex aivex:w-full aivex:flex-col aivex:gap-xs";
19
- function g({ title: e, titleId: n, description: i, headingButton: a, onClose: c, closeAriaLabel: u = "Close modal", ref: p, ...m }) {
20
- let g = l(f), v = /* @__PURE__ */ o("h2", {
19
+ function g({ title: e, titleId: n, description: i, headingButton: a, onClose: o, closeAriaLabel: c = "Close modal", ref: p, ...m }) {
20
+ let g = s(f), v = /* @__PURE__ */ l("h2", {
21
21
  ...n ? { id: n } : {},
22
22
  className: "aivex:m-0 aivex:whitespace-pre-line aivex:text-heading-xs aivex:text-text-primary aivex:break-words",
23
23
  children: e
24
- }), y = i ? /* @__PURE__ */ o("p", {
24
+ }), y = i ? /* @__PURE__ */ l("p", {
25
25
  className: "aivex:m-0 aivex:whitespace-pre-line aivex:text-body-md-regular aivex:text-text-secondary aivex:break-words",
26
26
  children: i
27
- }) : null, b = /* @__PURE__ */ o(r, {
27
+ }) : null, b = /* @__PURE__ */ l(r, {
28
28
  size: "md",
29
- onClick: c,
29
+ onClick: o,
30
30
  className: "aivex:shrink-0",
31
- "aria-label": u,
32
- children: /* @__PURE__ */ o(t, { size: 24 })
33
- }), x = a ? /* @__PURE__ */ o(_, { button: a }) : null;
34
- return /* @__PURE__ */ s("div", {
31
+ "aria-label": c,
32
+ children: /* @__PURE__ */ l(t, { size: 24 })
33
+ }), x = a ? /* @__PURE__ */ l(_, { button: a }) : null;
34
+ return /* @__PURE__ */ u("div", {
35
35
  ref: p,
36
36
  className: h,
37
37
  ...m,
38
- children: [/* @__PURE__ */ s("div", {
38
+ children: [/* @__PURE__ */ u("div", {
39
39
  className: "aivex:flex aivex:w-full aivex:items-center aivex:justify-center aivex:gap-md",
40
40
  children: [
41
41
  x,
42
- /* @__PURE__ */ o("div", {
42
+ /* @__PURE__ */ l("div", {
43
43
  className: "aivex:flex aivex:min-w-0 aivex:flex-1 aivex:flex-col aivex:justify-center",
44
- children: g ? /* @__PURE__ */ o(d.Title, {
44
+ children: g ? /* @__PURE__ */ l(d.Title, {
45
45
  asChild: !0,
46
46
  children: v
47
47
  }) : v
48
48
  }),
49
- c ? b : g && /* @__PURE__ */ o(d.Close, {
49
+ o ? b : g && /* @__PURE__ */ l(d.Close, {
50
50
  asChild: !0,
51
51
  children: b
52
52
  })
53
53
  ]
54
- }), g && y ? /* @__PURE__ */ o(d.Description, {
54
+ }), g && y ? /* @__PURE__ */ l(d.Description, {
55
55
  asChild: !0,
56
56
  children: y
57
57
  }) : y]
@@ -59,7 +59,7 @@ function g({ title: e, titleId: n, description: i, headingButton: a, onClose: c,
59
59
  }
60
60
  function _({ button: e }) {
61
61
  let { children: t, ...n } = e;
62
- return /* @__PURE__ */ o(r, {
62
+ return /* @__PURE__ */ l(r, {
63
63
  size: "md",
64
64
  className: "aivex:shrink-0",
65
65
  ...n,
@@ -67,7 +67,7 @@ function _({ button: e }) {
67
67
  });
68
68
  }
69
69
  function v({ children: e, ref: t, ...n }) {
70
- return /* @__PURE__ */ o("div", {
70
+ return /* @__PURE__ */ l("div", {
71
71
  ref: t,
72
72
  "data-aivex-modal-body": "",
73
73
  className: "aivex:flex aivex:min-h-0 aivex:flex-1 aivex:flex-col aivex:overflow-y-auto",
@@ -76,26 +76,26 @@ function v({ children: e, ref: t, ...n }) {
76
76
  });
77
77
  }
78
78
  function y({ tertiaryButton: e, secondaryButton: t, primaryButton: n, ref: r, ...i }) {
79
- return /* @__PURE__ */ s("div", {
79
+ return /* @__PURE__ */ u("div", {
80
80
  ref: r,
81
81
  className: "aivex:flex aivex:h-10 aivex:w-full aivex:items-center aivex:justify-end aivex:gap-lg",
82
82
  ...i,
83
- children: [/* @__PURE__ */ o("div", {
83
+ children: [/* @__PURE__ */ l("div", {
84
84
  className: "aivex:flex aivex:min-w-0 aivex:flex-1 aivex:items-center aivex:justify-start",
85
- children: e && /* @__PURE__ */ o(b, {
85
+ children: e && /* @__PURE__ */ l(b, {
86
86
  button: e,
87
87
  variant: "ghost",
88
88
  color: "secondary",
89
89
  className: "aivex:min-w-9"
90
90
  })
91
- }), /* @__PURE__ */ s("div", {
91
+ }), /* @__PURE__ */ u("div", {
92
92
  className: "aivex:flex aivex:shrink-0 aivex:items-center aivex:justify-end aivex:gap-lg",
93
- children: [t && /* @__PURE__ */ o(b, {
93
+ children: [t && /* @__PURE__ */ l(b, {
94
94
  button: t,
95
95
  variant: "solid",
96
96
  color: "secondary",
97
97
  className: "aivex:min-w-[84px]"
98
- }), n && /* @__PURE__ */ o(b, {
98
+ }), n && /* @__PURE__ */ l(b, {
99
99
  button: n,
100
100
  variant: "solid",
101
101
  color: "primary",
@@ -105,49 +105,49 @@ function y({ tertiaryButton: e, secondaryButton: t, primaryButton: n, ref: r, ..
105
105
  });
106
106
  }
107
107
  function b({ button: e, variant: t, color: r, className: i }) {
108
- let { children: a, ...s } = e;
109
- return /* @__PURE__ */ o(n, {
108
+ let { children: a, ...o } = e;
109
+ return /* @__PURE__ */ l(n, {
110
110
  variant: t,
111
111
  color: r,
112
112
  size: "lg",
113
113
  className: i,
114
- ...s,
114
+ ...o,
115
115
  children: a
116
116
  });
117
117
  }
118
- function x({ open: t, defaultOpen: n, onOpenChange: r, children: c, size: l = "md", closeOnInteractOutside: u = !0, onOpenAutoFocus: h, onCloseAutoFocus: g, onInteractOutside: _, onKeyDown: v, onKeyUp: y, ref: b, ...x }) {
118
+ function x({ open: t, defaultOpen: n, onOpenChange: r, children: o, size: s = "md", closeOnInteractOutside: c = !0, onOpenAutoFocus: h, onCloseAutoFocus: g, onInteractOutside: _, onKeyDown: v, onKeyUp: y, ref: b, ...x }) {
119
119
  let S = a(h, g);
120
- return /* @__PURE__ */ o(d.Root, {
120
+ return /* @__PURE__ */ l(d.Root, {
121
121
  open: t,
122
122
  defaultOpen: n,
123
123
  onOpenChange: r,
124
- children: /* @__PURE__ */ s(d.Portal, { children: [/* @__PURE__ */ o(d.Overlay, { className: i({ variant: "dim" }) }), /* @__PURE__ */ o(d.Content, {
124
+ children: /* @__PURE__ */ u(d.Portal, { children: [/* @__PURE__ */ l(d.Overlay, { className: i({ variant: "dim" }) }), /* @__PURE__ */ l(d.Content, {
125
125
  ref: b,
126
- className: e("aivex:fixed aivex:left-1/2 aivex:top-1/2 aivex:z-(--aivex-z-modal)", "aivex:-translate-x-1/2 aivex:-translate-y-1/2", m, p[l]),
126
+ className: e("aivex:fixed aivex:left-1/2 aivex:top-1/2 aivex:z-(--aivex-z-modal)", "aivex:-translate-x-1/2 aivex:-translate-y-1/2", m, p[s]),
127
127
  onInteractOutside: (e) => {
128
- _?.(e), !u && !e.defaultPrevented && e.preventDefault();
128
+ _?.(e), !c && !e.defaultPrevented && e.preventDefault();
129
129
  },
130
130
  ...S,
131
131
  onKeyDown: v,
132
132
  onKeyUp: y,
133
133
  ...x,
134
- children: /* @__PURE__ */ o(f.Provider, {
134
+ children: /* @__PURE__ */ l(f.Provider, {
135
135
  value: !0,
136
- children: c
136
+ children: o
137
137
  })
138
138
  })] })
139
139
  });
140
140
  }
141
- function S({ title: t, description: n, headingButton: r, children: i, tertiaryButton: a, secondaryButton: c, primaryButton: l, size: d = "md", onClose: f, closeAriaLabel: h, ref: _ }) {
142
- let b = u(), x = !!(a || c || l);
143
- return /* @__PURE__ */ s("div", {
141
+ function S({ title: t, description: n, headingButton: r, children: i, tertiaryButton: a, secondaryButton: o, primaryButton: s, size: d = "md", onClose: f, closeAriaLabel: h, ref: _ }) {
142
+ let b = c(), x = !!(a || o || s);
143
+ return /* @__PURE__ */ u("div", {
144
144
  ref: _,
145
145
  role: "dialog",
146
146
  "aria-modal": "true",
147
147
  "aria-labelledby": b,
148
148
  className: e(m, p[d]),
149
149
  children: [
150
- /* @__PURE__ */ o(g, {
150
+ /* @__PURE__ */ l(g, {
151
151
  title: t,
152
152
  titleId: b,
153
153
  description: n,
@@ -155,18 +155,18 @@ function S({ title: t, description: n, headingButton: r, children: i, tertiaryBu
155
155
  onClose: f,
156
156
  closeAriaLabel: h
157
157
  }),
158
- i && /* @__PURE__ */ o(v, { children: i }),
159
- x && /* @__PURE__ */ o(y, {
158
+ i && /* @__PURE__ */ l(v, { children: i }),
159
+ x && /* @__PURE__ */ l(y, {
160
160
  tertiaryButton: a,
161
- secondaryButton: c,
162
- primaryButton: l
161
+ secondaryButton: o,
162
+ primaryButton: s
163
163
  })
164
164
  ]
165
165
  });
166
166
  }
167
- function C({ open: e, defaultOpen: t, onOpenChange: n, title: r, description: i, headingButton: a, children: c, tertiaryButton: l, secondaryButton: u, primaryButton: d, size: f, closeOnInteractOutside: p, onOpenAutoFocus: m, closeAriaLabel: h }) {
168
- let _ = !!(l || u || d);
169
- return /* @__PURE__ */ s(x, {
167
+ function C({ open: e, defaultOpen: t, onOpenChange: n, title: r, description: i, headingButton: a, children: o, tertiaryButton: s, secondaryButton: c, primaryButton: d, size: f, closeOnInteractOutside: p, onOpenAutoFocus: m, closeAriaLabel: h }) {
168
+ let _ = !!(s || c || d);
169
+ return /* @__PURE__ */ u(x, {
170
170
  open: e,
171
171
  defaultOpen: t,
172
172
  onOpenChange: n,
@@ -175,16 +175,16 @@ function C({ open: e, defaultOpen: t, onOpenChange: n, title: r, description: i,
175
175
  onOpenAutoFocus: m,
176
176
  ...i ? {} : { "aria-describedby": void 0 },
177
177
  children: [
178
- /* @__PURE__ */ o(g, {
178
+ /* @__PURE__ */ l(g, {
179
179
  title: r,
180
180
  description: i,
181
181
  headingButton: a,
182
182
  closeAriaLabel: h
183
183
  }),
184
- c && /* @__PURE__ */ o(v, { children: c }),
185
- _ && /* @__PURE__ */ o(y, {
186
- tertiaryButton: l,
187
- secondaryButton: u,
184
+ o && /* @__PURE__ */ l(v, { children: o }),
185
+ _ && /* @__PURE__ */ l(y, {
186
+ tertiaryButton: s,
187
+ secondaryButton: c,
188
188
  primaryButton: d
189
189
  })
190
190
  ]
@@ -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(`../SelectBox/SelectBox.cjs`);let i=require(`react/jsx-runtime`),a=require(`react`);function o({onClick:e,disabled:n,"aria-label":r,children:a}){return(0,i.jsxs)(`button`,{type:`button`,"aria-label":r,disabled:n,onClick:e,className:`aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:h-8 aivex:w-8 aivex:items-center aivex:justify-center aivex:rounded-sm aivex:text-text-secondary aivex:disabled:opacity-disable aivex:disabled:pointer-events-none aivex:transition-colors`,children:[(0,i.jsx)(t.InteractionLayer,{variant:`default`}),a]})}function s({page:n,isActive:r,disabled:a,onClick:o}){return(0,i.jsxs)(`button`,{type:`button`,"aria-label":`Page ${n}`,"aria-current":r?`page`:void 0,disabled:a,onClick:o,className:e.cn(`aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:h-8 aivex:px-xs aivex:items-center aivex:justify-center aivex:rounded-full aivex:transition-colors aivex:disabled:opacity-disable aivex:disabled:pointer-events-none`,r?`aivex:bg-bg-brand-subtle aivex:text-text-brand`:`aivex:text-text-secondary`),children:[(0,i.jsx)(t.InteractionLayer,{variant:r?`strong`:`default`}),(0,i.jsx)(`span`,{className:`aivex:relative aivex:min-w-6 aivex:text-center aivex:text-label-lg`,children:n})]})}function c({className:t,totalPages:c,page:l,pageSize:u,disabled:d,pageSizeOptions:f,onPageChange:p,onPageSizeChange:m,ref:h,...g}){let _=(0,a.useRef)(void 0);c!=null&&(_.current=c);let v=c??_.current;if(v==null)return null;let y=Math.max(1,v),b=Math.min(Math.max(1,l),y),x=Math.floor((b-1)/10),S=x*10+1,C=Math.min(S+9,y),w=Array.from({length:C-S+1},(e,t)=>S+t),T=x===0,E=C===y,D=e=>{p(e)},O=e=>{m?.(Number(e))};return(0,i.jsxs)(`nav`,{ref:h,"aria-label":`Pagination`,className:e.cn(`aivex:flex aivex:items-center`,t),...g,children:[(0,i.jsx)(`div`,{className:`aivex:flex-1`}),(0,i.jsxs)(`div`,{className:`aivex:flex aivex:items-center aivex:gap-6 aivex:shrink-0`,children:[(0,i.jsxs)(`div`,{className:`aivex:flex aivex:gap-2`,children:[(0,i.jsx)(o,{"aria-label":`First page`,disabled:d||T,onClick:()=>D(1),children:(0,i.jsx)(n.DirectionDoubleLeftIcon,{size:16})}),(0,i.jsx)(o,{"aria-label":`Previous page group`,disabled:d||T,onClick:()=>D(S-10),children:(0,i.jsx)(n.DirectionLeftIcon,{size:16})})]}),(0,i.jsx)(`div`,{className:`aivex:flex aivex:gap-2`,children:w.map(e=>(0,i.jsx)(s,{page:e,isActive:e===b,disabled:d,onClick:()=>D(e)},e))}),(0,i.jsxs)(`div`,{className:`aivex:flex aivex:gap-2`,children:[(0,i.jsx)(o,{"aria-label":`Next page group`,disabled:d||E,onClick:()=>D(C+1),children:(0,i.jsx)(n.DirectionRightIcon,{size:16})}),(0,i.jsx)(o,{"aria-label":`Last page`,disabled:d||E,onClick:()=>D(y),children:(0,i.jsx)(n.DirectionDoubleRightIcon,{size:16})})]})]}),(0,i.jsx)(`div`,{className:`aivex:flex-1 aivex:flex aivex:items-center aivex:justify-end`,children:f&&(0,i.jsx)(r.SelectBox,{size:`sm`,className:`aivex:w-[116px] aivex:shrink-0`,value:String(u),disabled:d,groups:[{options:f.map(({value:e,label:t})=>({value:String(e),label:t}))}],onValueChange:O})})]})}exports.Pagination=c;
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(`../SelectBox/SelectBox.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`);function o({onClick:e,disabled:n,"aria-label":r,children:i}){return(0,a.jsxs)(`button`,{type:`button`,"aria-label":r,disabled:n,onClick:e,className:`aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:h-8 aivex:w-8 aivex:items-center aivex:justify-center aivex:rounded-sm aivex:text-text-secondary aivex:disabled:opacity-disable aivex:disabled:pointer-events-none aivex:transition-colors`,children:[(0,a.jsx)(t.InteractionLayer,{variant:`default`}),i]})}function s({page:n,isActive:r,disabled:i,onClick:o}){return(0,a.jsxs)(`button`,{type:`button`,"aria-label":`Page ${n}`,"aria-current":r?`page`:void 0,disabled:i,onClick:o,className:e.cn(`aivex:relative aivex:overflow-hidden aivex:group aivex:flex aivex:h-8 aivex:px-xs aivex:items-center aivex:justify-center aivex:rounded-full aivex:transition-colors aivex:disabled:opacity-disable aivex:disabled:pointer-events-none`,r?`aivex:bg-bg-brand-subtle aivex:text-text-brand`:`aivex:text-text-secondary`),children:[(0,a.jsx)(t.InteractionLayer,{variant:r?`strong`:`default`}),(0,a.jsx)(`span`,{className:`aivex:relative aivex:min-w-6 aivex:text-center aivex:text-label-lg`,children:n})]})}function c({className:t,totalPages:c,page:l,pageSize:u,disabled:d,pageSizeOptions:f,onPageChange:p,onPageSizeChange:m,ref:h,...g}){let _=(0,i.useRef)(void 0);c!=null&&(_.current=c);let v=c??_.current;if(v==null)return null;let y=Math.max(1,v),b=Math.min(Math.max(1,l),y),x=Math.floor((b-1)/10),S=x*10+1,C=Math.min(S+9,y),w=Array.from({length:C-S+1},(e,t)=>S+t),T=x===0,E=C===y,D=e=>{p(e)},O=e=>{m?.(Number(e))};return(0,a.jsxs)(`nav`,{ref:h,"aria-label":`Pagination`,className:e.cn(`aivex:flex aivex:items-center`,t),...g,children:[(0,a.jsx)(`div`,{className:`aivex:flex-1`}),(0,a.jsxs)(`div`,{className:`aivex:flex aivex:items-center aivex:gap-6 aivex:shrink-0`,children:[(0,a.jsxs)(`div`,{className:`aivex:flex aivex:gap-2`,children:[(0,a.jsx)(o,{"aria-label":`First page`,disabled:d||T,onClick:()=>D(1),children:(0,a.jsx)(n.DirectionDoubleLeftIcon,{size:16})}),(0,a.jsx)(o,{"aria-label":`Previous page group`,disabled:d||T,onClick:()=>D(S-10),children:(0,a.jsx)(n.DirectionLeftIcon,{size:16})})]}),(0,a.jsx)(`div`,{className:`aivex:flex aivex:gap-2`,children:w.map(e=>(0,a.jsx)(s,{page:e,isActive:e===b,disabled:d,onClick:()=>D(e)},e))}),(0,a.jsxs)(`div`,{className:`aivex:flex aivex:gap-2`,children:[(0,a.jsx)(o,{"aria-label":`Next page group`,disabled:d||E,onClick:()=>D(C+1),children:(0,a.jsx)(n.DirectionRightIcon,{size:16})}),(0,a.jsx)(o,{"aria-label":`Last page`,disabled:d||E,onClick:()=>D(y),children:(0,a.jsx)(n.DirectionDoubleRightIcon,{size:16})})]})]}),(0,a.jsx)(`div`,{className:`aivex:flex-1 aivex:flex aivex:items-center aivex:justify-end`,children:f&&(0,a.jsx)(r.SelectBox,{size:`sm`,className:`aivex:w-[116px] aivex:shrink-0`,value:String(u),disabled:d,groups:[{options:f.map(({value:e,label:t})=>({value:String(e),label:t}))}],onValueChange:O})})]})}exports.Pagination=c;
2
2
  //# sourceMappingURL=Pagination.cjs.map