boottent-design 0.1.136 → 0.1.138

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.
@@ -5,8 +5,8 @@ import * as w from "react";
5
5
  import M, { useState as pr, useEffect as Po } from "react";
6
6
  import { a as $, d as ct, c as So } from "./index-CEwEyzHV.js";
7
7
  import { S as R } from "./index-TpPaGoFn.js";
8
- import { p as te, R as Eo } from "./portal-container-B5qVgCSZ.js";
9
- import { a as Xs, b as Zs, c as Ks, d as Js, e as Qs, f as el, g as tl, h as rl, i as nl, j as ol, k as al, A as il, l as sl, m as ll, n as cl, o as dl, q as ul, D as ml, r as pl, s as fl, u as gl, v as bl, w as hl, M as vl, P as wl, z as yl, B as xl, C as Cl, E as Tl, T as Nl, F as Pl, G as Sl, H as El, x as Ol, y as kl } from "./portal-container-B5qVgCSZ.js";
8
+ import { p as te, R as Eo } from "./portal-container-kpgXLOax.js";
9
+ import { c as Xs, d as Zs, e as Ks, f as Js, g as Qs, h as el, i as tl, j as rl, k as nl, l as ol, m as al, A as il, D as sl, n as ll, a as cl, o as dl, q as ul, b as ml, r as pl, s as fl, u as gl, v as bl, w as hl, M as vl, P as wl, z as yl, B as xl, C as Cl, E as Tl, T as Nl, F as Pl, G as Sl, H as El, x as Ol, y as kl } from "./portal-container-kpgXLOax.js";
10
10
  var Tt = "Collapsible", [Oo, fr] = wt(Tt), [ko, Nt] = Oo(Tt), gr = w.forwardRef(
11
11
  (r, e) => {
12
12
  const {
@@ -1312,7 +1312,7 @@ export {
1312
1312
  ja as A,
1313
1313
  so as B,
1314
1314
  no as C,
1315
- Ya as D,
1315
+ ma as D,
1316
1316
  lo as E,
1317
1317
  $a as F,
1318
1318
  io as G,
@@ -1321,20 +1321,20 @@ export {
1321
1321
  er as P,
1322
1322
  Qa as R,
1323
1323
  Za as T,
1324
- _t as a,
1325
- Me as b,
1326
- ge as c,
1327
- _e as d,
1328
- ae as e,
1329
- Oe as f,
1330
- Se as g,
1331
- St as h,
1332
- pa as i,
1333
- Ie as j,
1334
- qa as k,
1335
- ma as l,
1336
- va as m,
1337
- It as n,
1324
+ It as a,
1325
+ Ya as b,
1326
+ _t as c,
1327
+ Me as d,
1328
+ ge as e,
1329
+ _e as f,
1330
+ ae as g,
1331
+ Oe as h,
1332
+ Se as i,
1333
+ St as j,
1334
+ pa as k,
1335
+ Ie as l,
1336
+ qa as m,
1337
+ va as n,
1338
1338
  Lt as o,
1339
1339
  Ha as p,
1340
1340
  Ft as q,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),o=require("./portal-container-CjCfY0e4.cjs"),n=require("react"),p=()=>{const[i,d]=n.useState([]);n.useEffect(()=>{const e=o.portalManager.subscribe((s,a)=>{d(t=>{const l=t.find(c=>c.id===s.id);return a?l?t:[...t,{...s,isOpen:a}]:t.map(c=>c.id===s.id?{...c,isOpen:!1}:c)})});return()=>{e()}},[]);const r=n.useCallback(e=>{o.portalManager.setPortalOpen(e,!1)},[]);n.useEffect(()=>{const e=[];return i.forEach(s=>{if(!s.isOpen){const a=setTimeout(()=>{d(t=>t.filter(l=>l.id!==s.id))},300);e.push(a)}}),()=>{e.forEach(s=>clearTimeout(s))}},[i]);const f=n.useCallback(e=>{const s=e.props;o.toast({title:s.title,description:s.description,action:s.action,closeButton:s.closeButton,variant:s.variant,position:s.position,size:s.size,className:s.className}),r(e.id)},[r]);return n.useEffect(()=>{i.forEach(e=>{e.type==="toast"&&e.isOpen&&f(e)})},[i,f]),u.jsxs(o.PortalContainer,{children:[u.jsx(o.ToastForm,{}),i.map(e=>{var s;if(!e.isOpen)return null;switch(e.type){case"modal":return u.jsx(o.ModalForm,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),r(e.id)},description:(s=e.props.description)==null?void 0:s.toString()},e.id);case"alert":return u.jsx(o.AlertForm,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),r(e.id)}},e.id);case"dialog":return u.jsx(o.DialogForm,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),r(e.id)}},e.id);case"toast":return null;default:return null}})]})};exports.PortalProvider=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("./portal-container-CjCfY0e4.cjs"),m=require("./index-Cv9m35ew.cjs"),r=require("react"),p=r.forwardRef(({open:t,onClose:u,className:n,contents:d},e)=>i.jsx(o.Dialog,{open:t,onOpenChange:s=>{!s&&u&&u()},children:i.jsx(o.DialogContent,{ref:e,className:m.cn(n),children:d})})),C=()=>{const[t,u]=r.useState([]);r.useEffect(()=>{const e=o.portalManager.subscribe((s,l)=>{u(c=>{const f=c.find(a=>a.id===s.id);return l?f?c:[...c,{...s,isOpen:l}]:c.map(a=>a.id===s.id?{...a,isOpen:!1}:a)})});return()=>{e()}},[]);const n=r.useCallback(e=>{o.portalManager.setPortalOpen(e,!1)},[]);r.useEffect(()=>{const e=[];return t.forEach(s=>{if(!s.isOpen){const l=setTimeout(()=>{u(c=>c.filter(f=>f.id!==s.id))},300);e.push(l)}}),()=>{e.forEach(s=>clearTimeout(s))}},[t]);const d=r.useCallback(e=>{const s=e.props;o.toast({title:s.title,description:s.description,action:s.action,closeButton:s.closeButton,variant:s.variant,position:s.position,size:s.size,className:s.className}),n(e.id)},[n]);return r.useEffect(()=>{t.forEach(e=>{e.type==="toast"&&e.isOpen&&d(e)})},[t,d]),i.jsxs(o.PortalContainer,{children:[i.jsx(o.ToastForm,{}),t.map(e=>{var s;if(!e.isOpen)return null;switch(e.type){case"modal":return i.jsx(o.ModalForm,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),n(e.id)},description:(s=e.props.description)==null?void 0:s.toString()},e.id);case"alert":return i.jsx(o.AlertForm,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),n(e.id)}},e.id);case"dialog":return i.jsx(o.DialogForm,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),n(e.id)}},e.id);case"custom":return i.jsx(p,{...e.props,onClose:()=>{e.props.onClose&&e.props.onClose(),n(e.id)}},e.id);case"toast":return null;default:return null}})]})};exports.PortalProvider=C;
@@ -1,39 +1,49 @@
1
- import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
- import { p as m, t as C, P as h, T as P, D as b, A as g, M as T } from "./portal-container-B5qVgCSZ.js";
3
- import { useState as x, useEffect as u, useCallback as f } from "react";
4
- const M = () => {
5
- const [i, d] = x([]);
6
- u(() => {
7
- const s = m.subscribe((e, r) => {
8
- d((o) => {
9
- const c = o.find((n) => n.id === e.id);
10
- return r ? c ? o : [...o, { ...e, isOpen: r }] : o.map((n) => n.id === e.id ? { ...n, isOpen: !1 } : n);
1
+ import { jsx as i, jsxs as p } from "react/jsx-runtime";
2
+ import { D as C, a as h, p as m, t as g, P, T as b, b as F, A as O, M as T } from "./portal-container-kpgXLOax.js";
3
+ import { c as x } from "./index-CWHiF7D_.js";
4
+ import { forwardRef as D, useState as E, useEffect as l, useCallback as f } from "react";
5
+ const M = D(({ open: n, onClose: t, className: o, contents: a }, s) => /* @__PURE__ */ i(
6
+ C,
7
+ {
8
+ open: n,
9
+ onOpenChange: (e) => {
10
+ !e && t && t();
11
+ },
12
+ children: /* @__PURE__ */ i(h, { ref: s, className: x(o), children: a })
13
+ }
14
+ )), z = () => {
15
+ const [n, t] = E([]);
16
+ l(() => {
17
+ const s = m.subscribe((e, u) => {
18
+ t((r) => {
19
+ const d = r.find((c) => c.id === e.id);
20
+ return u ? d ? r : [...r, { ...e, isOpen: u }] : r.map((c) => c.id === e.id ? { ...c, isOpen: !1 } : c);
11
21
  });
12
22
  });
13
23
  return () => {
14
24
  s();
15
25
  };
16
26
  }, []);
17
- const t = f((s) => {
27
+ const o = f((s) => {
18
28
  m.setPortalOpen(s, !1);
19
29
  }, []);
20
- u(() => {
30
+ l(() => {
21
31
  const s = [];
22
- return i.forEach((e) => {
32
+ return n.forEach((e) => {
23
33
  if (!e.isOpen) {
24
- const r = setTimeout(() => {
25
- d((o) => o.filter((c) => c.id !== e.id));
34
+ const u = setTimeout(() => {
35
+ t((r) => r.filter((d) => d.id !== e.id));
26
36
  }, 300);
27
- s.push(r);
37
+ s.push(u);
28
38
  }
29
39
  }), () => {
30
40
  s.forEach((e) => clearTimeout(e));
31
41
  };
32
- }, [i]);
33
- const l = f(
42
+ }, [n]);
43
+ const a = f(
34
44
  (s) => {
35
45
  const e = s.props;
36
- C({
46
+ g({
37
47
  title: e.title,
38
48
  description: e.description,
39
49
  action: e.action,
@@ -42,50 +52,61 @@ const M = () => {
42
52
  position: e.position,
43
53
  size: e.size,
44
54
  className: e.className
45
- }), t(s.id);
55
+ }), o(s.id);
46
56
  },
47
- [t]
57
+ [o]
48
58
  );
49
- return u(() => {
50
- i.forEach((s) => {
51
- s.type === "toast" && s.isOpen && l(s);
59
+ return l(() => {
60
+ n.forEach((s) => {
61
+ s.type === "toast" && s.isOpen && a(s);
52
62
  });
53
- }, [i, l]), /* @__PURE__ */ p(h, { children: [
54
- /* @__PURE__ */ a(P, {}),
55
- i.map((s) => {
63
+ }, [n, a]), /* @__PURE__ */ p(P, { children: [
64
+ /* @__PURE__ */ i(b, {}),
65
+ n.map((s) => {
56
66
  var e;
57
67
  if (!s.isOpen) return null;
58
68
  switch (s.type) {
59
69
  case "modal":
60
- return /* @__PURE__ */ a(
70
+ return /* @__PURE__ */ i(
61
71
  T,
62
72
  {
63
73
  ...s.props,
64
74
  onClose: () => {
65
- s.props.onClose && s.props.onClose(), t(s.id);
75
+ s.props.onClose && s.props.onClose(), o(s.id);
66
76
  },
67
77
  description: (e = s.props.description) == null ? void 0 : e.toString()
68
78
  },
69
79
  s.id
70
80
  );
71
81
  case "alert":
72
- return /* @__PURE__ */ a(
73
- g,
82
+ return /* @__PURE__ */ i(
83
+ O,
74
84
  {
75
85
  ...s.props,
76
86
  onClose: () => {
77
- s.props.onClose && s.props.onClose(), t(s.id);
87
+ s.props.onClose && s.props.onClose(), o(s.id);
78
88
  }
79
89
  },
80
90
  s.id
81
91
  );
82
92
  case "dialog":
83
- return /* @__PURE__ */ a(
84
- b,
93
+ return /* @__PURE__ */ i(
94
+ F,
95
+ {
96
+ ...s.props,
97
+ onClose: () => {
98
+ s.props.onClose && s.props.onClose(), o(s.id);
99
+ }
100
+ },
101
+ s.id
102
+ );
103
+ case "custom":
104
+ return /* @__PURE__ */ i(
105
+ M,
85
106
  {
86
107
  ...s.props,
87
108
  onClose: () => {
88
- s.props.onClose && s.props.onClose(), t(s.id);
109
+ s.props.onClose && s.props.onClose(), o(s.id);
89
110
  }
90
111
  },
91
112
  s.id
@@ -99,5 +120,5 @@ const M = () => {
99
120
  ] });
100
121
  };
101
122
  export {
102
- M as PortalProvider
123
+ z as PortalProvider
103
124
  };
@@ -34,6 +34,12 @@ declare const buttonVariants: (props?: ({
34
34
  shape?: "square" | "rounded" | null | undefined;
35
35
  } & ClassProp) | undefined) => string;
36
36
 
37
+ export declare interface CustomPortalOptions {
38
+ id: string;
39
+ type: "custom";
40
+ props: FreeFormProps;
41
+ }
42
+
37
43
  export declare interface DialogPortalOptions {
38
44
  id: string;
39
45
  type: "dialog";
@@ -138,7 +144,7 @@ export declare interface ModalProps {
138
144
  className?: string;
139
145
  }
140
146
 
141
- export declare type PortalOptions = ModalPortalOptions | ToastPortalOptions | AlertPortalOptions | DialogPortalOptions;
147
+ export declare type PortalOptions = ModalPortalOptions | ToastPortalOptions | AlertPortalOptions | DialogPortalOptions | CustomPortalOptions;
142
148
 
143
149
  export declare type PortalType = "modal" | "toast" | "alert" | "dialog" | "custom";
144
150
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "boottent-design",
3
3
  "private": false,
4
- "version": "0.1.136",
4
+ "version": "0.1.138",
5
5
  "description": "부트텐트 디자인시스템 라이브러리",
6
6
  "repository": {
7
7
  "type": "git",