@kimkihwan/cytur-design-system 0.5.0 → 0.5.1

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/index.js CHANGED
@@ -9066,11 +9066,118 @@ var xm = i(({ children: t, ...n }, r) => /* @__PURE__ */ J("caption", {
9066
9066
  }));
9067
9067
  xm.displayName = "TableCaption";
9068
9068
  //#endregion
9069
+ //#region src/components/table/DataTable.tsx
9070
+ function Sm({ columns: t, data: n, rowKey: r = "id", striped: i = !1, pagination: a = !1, pageSize: o = 10, pageSizeOptions: s = [
9071
+ 5,
9072
+ 10,
9073
+ 20,
9074
+ 50
9075
+ ], showGoTo: c = !1, selectable: l = !1, selectedKey: d = null, onRowClick: p, emptyText: m = "No data", ...h }) {
9076
+ let [g, _] = f(null), [v, y] = f("none"), [b, x] = f({}), [S, C] = f(1), [w, T] = f(o), E = u(() => {
9077
+ let e = {};
9078
+ return t.forEach((t) => {
9079
+ t.filterable && (e[t.key] = [...new Set(n.map((e) => String(e[t.key])))]);
9080
+ }), e;
9081
+ }, [t, n]), D = u(() => {
9082
+ let e = n;
9083
+ return Object.entries(b).forEach(([t, n]) => {
9084
+ n.length > 0 && (e = e.filter((e) => n.includes(String(e[t]))));
9085
+ }), e;
9086
+ }, [n, b]), O = u(() => !g || v === "none" ? D : [...D].sort((e, t) => {
9087
+ let n = String(e[g] ?? ""), r = String(t[g] ?? ""), i = Number(n), a = Number(r);
9088
+ return !isNaN(i) && !isNaN(a) ? v === "asc" ? i - a : a - i : v === "asc" ? n.localeCompare(r) : r.localeCompare(n);
9089
+ }), [
9090
+ D,
9091
+ g,
9092
+ v
9093
+ ]), k = a ? Math.max(1, Math.ceil(O.length / w)) : 1, A = Math.min(S, k), j = a ? O.slice((A - 1) * w, A * w) : O, M = (e) => {
9094
+ g === e ? y((e) => e === "none" ? "asc" : e === "asc" ? "desc" : "none") : (_(e), y("asc"));
9095
+ }, N = (e) => (t) => {
9096
+ x((n) => ({
9097
+ ...n,
9098
+ [e]: t
9099
+ })), C(1);
9100
+ }, P = (e, t) => typeof r == "function" ? r(e, t) : e[r] ?? t, F = (e) => g === e ? v : "none";
9101
+ return /* @__PURE__ */ Y("div", {
9102
+ ...h,
9103
+ children: [/* @__PURE__ */ J("div", {
9104
+ css: e({
9105
+ border: "1px solid #e5e7eb",
9106
+ borderRadius: "8px",
9107
+ overflow: "hidden",
9108
+ background: "#fff"
9109
+ }),
9110
+ children: /* @__PURE__ */ Y(mm, {
9111
+ striped: i,
9112
+ children: [/* @__PURE__ */ J(hm, { children: /* @__PURE__ */ J(_m, { children: t.map((t) => /* @__PURE__ */ J(ym, {
9113
+ sortable: t.sortable,
9114
+ sortDirection: t.sortable ? F(t.key) : void 0,
9115
+ onSort: t.sortable ? () => M(t.key) : void 0,
9116
+ filterable: t.filterable,
9117
+ filterOptions: t.filterable ? E[t.key] : void 0,
9118
+ filterValue: t.filterable ? b[t.key] ?? [] : void 0,
9119
+ onFilterChange: t.filterable ? N(t.key) : void 0,
9120
+ css: e({
9121
+ ...t.width ? { width: t.width } : {},
9122
+ ...t.align ? { textAlign: t.align } : {}
9123
+ }),
9124
+ children: t.label
9125
+ }, t.key)) }) }), /* @__PURE__ */ J(gm, { children: j.length === 0 ? /* @__PURE__ */ J(_m, { children: /* @__PURE__ */ J(bm, {
9126
+ colSpan: t.length,
9127
+ children: /* @__PURE__ */ J("div", {
9128
+ css: e({
9129
+ display: "flex",
9130
+ alignItems: "center",
9131
+ justifyContent: "center",
9132
+ padding: "40px 0",
9133
+ color: "#9ca3af",
9134
+ fontSize: "14px",
9135
+ fontFamily: W.family
9136
+ }),
9137
+ children: m
9138
+ })
9139
+ }) }) : j.map((n, r) => {
9140
+ let i = P(n, r);
9141
+ return /* @__PURE__ */ J(_m, {
9142
+ selected: l && d === i,
9143
+ onClick: p ? () => p(n, r) : void 0,
9144
+ css: p ? e({ cursor: "pointer" }) : void 0,
9145
+ children: t.map((t) => /* @__PURE__ */ J(bm, {
9146
+ css: t.align ? e({ textAlign: t.align }) : void 0,
9147
+ children: t.render ? t.render(n[t.key], n, r) : String(n[t.key] ?? "")
9148
+ }, t.key))
9149
+ }, i);
9150
+ }) })]
9151
+ })
9152
+ }), a && k > 0 && /* @__PURE__ */ J("div", {
9153
+ css: e({
9154
+ display: "flex",
9155
+ justifyContent: "center",
9156
+ marginTop: "16px"
9157
+ }),
9158
+ children: /* @__PURE__ */ J(fm, {
9159
+ size: "sm",
9160
+ totalPages: k,
9161
+ currentPage: A,
9162
+ onChange: C,
9163
+ showPageSize: !0,
9164
+ pageSize: w,
9165
+ pageSizeOptions: s,
9166
+ onPageSizeChange: (e) => {
9167
+ T(e), C(1);
9168
+ },
9169
+ showGoTo: c
9170
+ })
9171
+ })]
9172
+ });
9173
+ }
9174
+ Sm.displayName = "DataTable";
9175
+ //#endregion
9069
9176
  //#region src/components/file/File.tsx
9070
- var Sm = t`
9177
+ var Cm = t`
9071
9178
  from { transform: rotate(0deg); }
9072
9179
  to { transform: rotate(360deg); }
9073
- `, Cm = i(({ state: t = "default", children: n, ...r }, i) => {
9180
+ `, wm = i(({ state: t = "default", children: n, ...r }, i) => {
9074
9181
  let a = t === "loading";
9075
9182
  return /* @__PURE__ */ Y("a", {
9076
9183
  ref: i,
@@ -9101,7 +9208,7 @@ var Sm = t`
9101
9208
  children: [a ? /* @__PURE__ */ J("span", {
9102
9209
  css: e({
9103
9210
  display: "inline-flex",
9104
- animation: `${Sm} 1s linear infinite`
9211
+ animation: `${Cm} 1s linear infinite`
9105
9212
  }),
9106
9213
  children: /* @__PURE__ */ J(X, {
9107
9214
  name: "autorenew",
@@ -9113,10 +9220,10 @@ var Sm = t`
9113
9220
  }), n]
9114
9221
  });
9115
9222
  });
9116
- Cm.displayName = "File";
9223
+ wm.displayName = "File";
9117
9224
  //#endregion
9118
9225
  //#region src/components/avatar/Avatar.tsx
9119
- var wm = {
9226
+ var Tm = {
9120
9227
  sm: {
9121
9228
  px: "24px",
9122
9229
  fontSize: "12px",
@@ -9132,8 +9239,8 @@ var wm = {
9132
9239
  fontSize: "16px",
9133
9240
  lineHeight: "24px"
9134
9241
  }
9135
- }, Tm = (e, t) => t === "circle" ? "50%" : e === "sm" ? "4px" : "8px", Em = i(({ size: t = "md", shape: n = "circle", src: r, alt: i = "", initials: a, children: o, ...s }, c) => {
9136
- let l = wm[t], u = !!r;
9242
+ }, Em = (e, t) => t === "circle" ? "50%" : e === "sm" ? "4px" : "8px", Dm = i(({ size: t = "md", shape: n = "circle", src: r, alt: i = "", initials: a, children: o, ...s }, c) => {
9243
+ let l = Tm[t], u = !!r;
9137
9244
  return /* @__PURE__ */ J("div", {
9138
9245
  ref: c,
9139
9246
  css: e({
@@ -9142,7 +9249,7 @@ var wm = {
9142
9249
  justifyContent: "center",
9143
9250
  width: l.px,
9144
9251
  height: l.px,
9145
- borderRadius: Tm(t, n),
9252
+ borderRadius: Em(t, n),
9146
9253
  overflow: "hidden",
9147
9254
  background: u ? ae.color.bg.image : ae.color.bg.default,
9148
9255
  flexShrink: 0
@@ -9170,17 +9277,17 @@ var wm = {
9170
9277
  })
9171
9278
  });
9172
9279
  });
9173
- Em.displayName = "Avatar";
9280
+ Dm.displayName = "Avatar";
9174
9281
  //#endregion
9175
9282
  //#region node_modules/@radix-ui/react-dialog/dist/index.mjs
9176
- var Dm = "Dialog", [Om, km] = Cn(Dm), [Am, jm] = Om(Dm), Mm = (e) => {
9283
+ var Om = "Dialog", [km, Am] = Cn(Om), [jm, Mm] = km(Om), Nm = (e) => {
9177
9284
  let { __scopeDialog: t, children: r, open: i, defaultOpen: a, onOpenChange: o, modal: s = !0 } = e, c = n.useRef(null), l = n.useRef(null), [u, d] = lo({
9178
9285
  prop: i,
9179
9286
  defaultProp: a ?? !1,
9180
9287
  onChange: o,
9181
- caller: Dm
9288
+ caller: Om
9182
9289
  });
9183
- return /* @__PURE__ */ h(Am, {
9290
+ return /* @__PURE__ */ h(jm, {
9184
9291
  scope: t,
9185
9292
  triggerRef: c,
9186
9293
  contentRef: l,
@@ -9194,24 +9301,24 @@ var Dm = "Dialog", [Om, km] = Cn(Dm), [Am, jm] = Om(Dm), Mm = (e) => {
9194
9301
  children: r
9195
9302
  });
9196
9303
  };
9197
- Mm.displayName = Dm;
9198
- var Nm = "DialogTrigger", Pm = n.forwardRef((e, t) => {
9199
- let { __scopeDialog: n, ...r } = e, i = jm(Nm, n), a = Q(t, i.triggerRef);
9304
+ Nm.displayName = Om;
9305
+ var Pm = "DialogTrigger", Fm = n.forwardRef((e, t) => {
9306
+ let { __scopeDialog: n, ...r } = e, i = Mm(Pm, n), a = Q(t, i.triggerRef);
9200
9307
  return /* @__PURE__ */ h($.button, {
9201
9308
  type: "button",
9202
9309
  "aria-haspopup": "dialog",
9203
9310
  "aria-expanded": i.open,
9204
9311
  "aria-controls": i.contentId,
9205
- "data-state": eh(i.open),
9312
+ "data-state": th(i.open),
9206
9313
  ...r,
9207
9314
  ref: a,
9208
9315
  onClick: Z(e.onClick, i.onOpenToggle)
9209
9316
  });
9210
9317
  });
9211
- Pm.displayName = Nm;
9212
- var Fm = "DialogPortal", [Im, Lm] = Om(Fm, { forceMount: void 0 }), Rm = (e) => {
9213
- let { __scopeDialog: t, forceMount: r, children: i, container: a } = e, o = jm(Fm, t);
9214
- return /* @__PURE__ */ h(Im, {
9318
+ Fm.displayName = Pm;
9319
+ var Im = "DialogPortal", [Lm, Rm] = km(Im, { forceMount: void 0 }), zm = (e) => {
9320
+ let { __scopeDialog: t, forceMount: r, children: i, container: a } = e, o = Mm(Im, t);
9321
+ return /* @__PURE__ */ h(Lm, {
9215
9322
  scope: t,
9216
9323
  forceMount: r,
9217
9324
  children: n.Children.map(i, (e) => /* @__PURE__ */ h(zl, {
@@ -9224,26 +9331,26 @@ var Fm = "DialogPortal", [Im, Lm] = Om(Fm, { forceMount: void 0 }), Rm = (e) =>
9224
9331
  }))
9225
9332
  });
9226
9333
  };
9227
- Rm.displayName = Fm;
9228
- var zm = "DialogOverlay", Bm = n.forwardRef((e, t) => {
9229
- let n = Lm(zm, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = jm(zm, e.__scopeDialog);
9334
+ zm.displayName = Im;
9335
+ var Bm = "DialogOverlay", Vm = n.forwardRef((e, t) => {
9336
+ let n = Rm(Bm, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = Mm(Bm, e.__scopeDialog);
9230
9337
  return a.modal ? /* @__PURE__ */ h(zl, {
9231
9338
  present: r || a.open,
9232
- children: /* @__PURE__ */ h(Hm, {
9339
+ children: /* @__PURE__ */ h(Um, {
9233
9340
  ...i,
9234
9341
  ref: t
9235
9342
  })
9236
9343
  }) : null;
9237
9344
  });
9238
- Bm.displayName = zm;
9239
- var Vm = /* @__PURE__ */ Dn("DialogOverlay.RemoveScroll"), Hm = n.forwardRef((e, t) => {
9240
- let { __scopeDialog: n, ...r } = e, i = jm(zm, n);
9345
+ Vm.displayName = Bm;
9346
+ var Hm = /* @__PURE__ */ Dn("DialogOverlay.RemoveScroll"), Um = n.forwardRef((e, t) => {
9347
+ let { __scopeDialog: n, ...r } = e, i = Mm(Bm, n);
9241
9348
  return /* @__PURE__ */ h(Fs, {
9242
- as: Vm,
9349
+ as: Hm,
9243
9350
  allowPinchZoom: !0,
9244
9351
  shards: [i.contentRef],
9245
9352
  children: /* @__PURE__ */ h($.div, {
9246
- "data-state": eh(i.open),
9353
+ "data-state": th(i.open),
9247
9354
  ...r,
9248
9355
  ref: t,
9249
9356
  style: {
@@ -9252,26 +9359,26 @@ var Vm = /* @__PURE__ */ Dn("DialogOverlay.RemoveScroll"), Hm = n.forwardRef((e,
9252
9359
  }
9253
9360
  })
9254
9361
  });
9255
- }), Um = "DialogContent", Wm = n.forwardRef((e, t) => {
9256
- let n = Lm(Um, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = jm(Um, e.__scopeDialog);
9362
+ }), Wm = "DialogContent", Gm = n.forwardRef((e, t) => {
9363
+ let n = Rm(Wm, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = Mm(Wm, e.__scopeDialog);
9257
9364
  return /* @__PURE__ */ h(zl, {
9258
9365
  present: r || a.open,
9259
- children: a.modal ? /* @__PURE__ */ h(Gm, {
9366
+ children: a.modal ? /* @__PURE__ */ h(Km, {
9260
9367
  ...i,
9261
9368
  ref: t
9262
- }) : /* @__PURE__ */ h(Km, {
9369
+ }) : /* @__PURE__ */ h(qm, {
9263
9370
  ...i,
9264
9371
  ref: t
9265
9372
  })
9266
9373
  });
9267
9374
  });
9268
- Wm.displayName = Um;
9269
- var Gm = n.forwardRef((e, t) => {
9270
- let r = jm(Um, e.__scopeDialog), i = n.useRef(null), a = Q(t, r.contentRef, i);
9375
+ Gm.displayName = Wm;
9376
+ var Km = n.forwardRef((e, t) => {
9377
+ let r = Mm(Wm, e.__scopeDialog), i = n.useRef(null), a = Q(t, r.contentRef, i);
9271
9378
  return n.useEffect(() => {
9272
9379
  let e = i.current;
9273
9380
  if (e) return Eo(e);
9274
- }, []), /* @__PURE__ */ h(qm, {
9381
+ }, []), /* @__PURE__ */ h(Jm, {
9275
9382
  ...e,
9276
9383
  ref: a,
9277
9384
  trapFocus: r.open,
@@ -9285,9 +9392,9 @@ var Gm = n.forwardRef((e, t) => {
9285
9392
  }),
9286
9393
  onFocusOutside: Z(e.onFocusOutside, (e) => e.preventDefault())
9287
9394
  });
9288
- }), Km = n.forwardRef((e, t) => {
9289
- let r = jm(Um, e.__scopeDialog), i = n.useRef(!1), a = n.useRef(!1);
9290
- return /* @__PURE__ */ h(qm, {
9395
+ }), qm = n.forwardRef((e, t) => {
9396
+ let r = Mm(Wm, e.__scopeDialog), i = n.useRef(!1), a = n.useRef(!1);
9397
+ return /* @__PURE__ */ h(Jm, {
9291
9398
  ...e,
9292
9399
  ref: t,
9293
9400
  trapFocus: !1,
@@ -9301,8 +9408,8 @@ var Gm = n.forwardRef((e, t) => {
9301
9408
  r.triggerRef.current?.contains(n) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && a.current && t.preventDefault();
9302
9409
  }
9303
9410
  });
9304
- }), qm = n.forwardRef((e, t) => {
9305
- let { __scopeDialog: r, trapFocus: i, onOpenAutoFocus: a, onCloseAutoFocus: o, ...s } = e, c = jm(Um, r), l = n.useRef(null), u = Q(t, l);
9411
+ }), Jm = n.forwardRef((e, t) => {
9412
+ let { __scopeDialog: r, trapFocus: i, onOpenAutoFocus: a, onCloseAutoFocus: o, ...s } = e, c = Mm(Wm, r), l = n.useRef(null), u = Q(t, l);
9306
9413
  return er(), /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(or, {
9307
9414
  asChild: !0,
9308
9415
  loop: !0,
@@ -9314,35 +9421,35 @@ var Gm = n.forwardRef((e, t) => {
9314
9421
  id: c.contentId,
9315
9422
  "aria-describedby": c.descriptionId,
9316
9423
  "aria-labelledby": c.titleId,
9317
- "data-state": eh(c.open),
9424
+ "data-state": th(c.open),
9318
9425
  ...s,
9319
9426
  ref: u,
9320
9427
  onDismiss: () => c.onOpenChange(!1)
9321
9428
  })
9322
- }), /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(ih, { titleId: c.titleId }), /* @__PURE__ */ h(oh, {
9429
+ }), /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(ah, { titleId: c.titleId }), /* @__PURE__ */ h(sh, {
9323
9430
  contentRef: l,
9324
9431
  descriptionId: c.descriptionId
9325
9432
  })] })] });
9326
- }), Jm = "DialogTitle", Ym = n.forwardRef((e, t) => {
9327
- let { __scopeDialog: n, ...r } = e, i = jm(Jm, n);
9433
+ }), Ym = "DialogTitle", Xm = n.forwardRef((e, t) => {
9434
+ let { __scopeDialog: n, ...r } = e, i = Mm(Ym, n);
9328
9435
  return /* @__PURE__ */ h($.h2, {
9329
9436
  id: i.titleId,
9330
9437
  ...r,
9331
9438
  ref: t
9332
9439
  });
9333
9440
  });
9334
- Ym.displayName = Jm;
9335
- var Xm = "DialogDescription", Zm = n.forwardRef((e, t) => {
9336
- let { __scopeDialog: n, ...r } = e, i = jm(Xm, n);
9441
+ Xm.displayName = Ym;
9442
+ var Zm = "DialogDescription", Qm = n.forwardRef((e, t) => {
9443
+ let { __scopeDialog: n, ...r } = e, i = Mm(Zm, n);
9337
9444
  return /* @__PURE__ */ h($.p, {
9338
9445
  id: i.descriptionId,
9339
9446
  ...r,
9340
9447
  ref: t
9341
9448
  });
9342
9449
  });
9343
- Zm.displayName = Xm;
9344
- var Qm = "DialogClose", $m = n.forwardRef((e, t) => {
9345
- let { __scopeDialog: n, ...r } = e, i = jm(Qm, n);
9450
+ Qm.displayName = Zm;
9451
+ var $m = "DialogClose", eh = n.forwardRef((e, t) => {
9452
+ let { __scopeDialog: n, ...r } = e, i = Mm($m, n);
9346
9453
  return /* @__PURE__ */ h($.button, {
9347
9454
  type: "button",
9348
9455
  ...r,
@@ -9350,16 +9457,16 @@ var Qm = "DialogClose", $m = n.forwardRef((e, t) => {
9350
9457
  onClick: Z(e.onClick, () => i.onOpenChange(!1))
9351
9458
  });
9352
9459
  });
9353
- $m.displayName = Qm;
9354
- function eh(e) {
9460
+ eh.displayName = $m;
9461
+ function th(e) {
9355
9462
  return e ? "open" : "closed";
9356
9463
  }
9357
- var th = "DialogTitleWarning", [nh, rh] = Sn(th, {
9358
- contentName: Um,
9359
- titleName: Jm,
9464
+ var nh = "DialogTitleWarning", [rh, ih] = Sn(nh, {
9465
+ contentName: Wm,
9466
+ titleName: Ym,
9360
9467
  docsSlug: "dialog"
9361
- }), ih = ({ titleId: e }) => {
9362
- let t = rh(th), r = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
9468
+ }), ah = ({ titleId: e }) => {
9469
+ let t = ih(nh), r = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
9363
9470
 
9364
9471
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
9365
9472
 
@@ -9367,8 +9474,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
9367
9474
  return n.useEffect(() => {
9368
9475
  e && (document.getElementById(e) || console.error(r));
9369
9476
  }, [r, e]), null;
9370
- }, ah = "DialogDescriptionWarning", oh = ({ contentRef: e, descriptionId: t }) => {
9371
- let r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rh(ah).contentName}}.`;
9477
+ }, oh = "DialogDescriptionWarning", sh = ({ contentRef: e, descriptionId: t }) => {
9478
+ let r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ih(oh).contentName}}.`;
9372
9479
  return n.useEffect(() => {
9373
9480
  let n = e.current?.getAttribute("aria-describedby");
9374
9481
  t && n && (document.getElementById(t) || console.warn(r));
@@ -9377,7 +9484,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
9377
9484
  e,
9378
9485
  t
9379
9486
  ]), null;
9380
- }, sh = Mm, ch = Rm, lh = Bm, uh = Wm, dh = Ym, fh = Zm, ph = $m, mh = {
9487
+ }, ch = Nm, lh = zm, uh = Vm, dh = Gm, fh = Xm, ph = Qm, mh = eh, hh = {
9381
9488
  sm: {
9382
9489
  width: "360px",
9383
9490
  headerPt: "16px",
@@ -9414,24 +9521,24 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
9414
9521
  footerPx: "24px",
9415
9522
  scrollHeight: "640px"
9416
9523
  }
9417
- }, hh = t`
9524
+ }, gh = t`
9418
9525
  from { opacity: 0; }
9419
9526
  to { opacity: 1; }
9420
- `, gh = t`
9527
+ `, _h = t`
9421
9528
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
9422
9529
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
9423
- `, _h = ({ open: t, onOpenChange: n, size: r = "md", showClose: i = !0, children: a }) => {
9424
- let o = mh[r];
9425
- return /* @__PURE__ */ J(sh, {
9530
+ `, vh = ({ open: t, onOpenChange: n, size: r = "md", showClose: i = !0, children: a }) => {
9531
+ let o = hh[r];
9532
+ return /* @__PURE__ */ J(ch, {
9426
9533
  open: t,
9427
9534
  onOpenChange: n,
9428
- children: /* @__PURE__ */ Y(ch, { children: [/* @__PURE__ */ J(lh, { css: e({
9535
+ children: /* @__PURE__ */ Y(lh, { children: [/* @__PURE__ */ J(uh, { css: e({
9429
9536
  position: "fixed",
9430
9537
  inset: 0,
9431
9538
  background: ie.overlay,
9432
- animation: `${hh} 150ms ease`,
9539
+ animation: `${gh} 150ms ease`,
9433
9540
  zIndex: 999
9434
- }) }), /* @__PURE__ */ Y(uh, {
9541
+ }) }), /* @__PURE__ */ Y(dh, {
9435
9542
  css: e({
9436
9543
  position: "fixed",
9437
9544
  top: "50%",
@@ -9447,12 +9554,12 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
9447
9554
  flexDirection: "column",
9448
9555
  overflow: "hidden",
9449
9556
  fontFamily: W.family,
9450
- animation: `${gh} 150ms ease`,
9557
+ animation: `${_h} 150ms ease`,
9451
9558
  zIndex: 1e3,
9452
9559
  "&:focus": { outline: "none" }
9453
9560
  }),
9454
9561
  "data-modal-size": r,
9455
- children: [i && /* @__PURE__ */ J(ph, {
9562
+ children: [i && /* @__PURE__ */ J(mh, {
9456
9563
  asChild: !0,
9457
9564
  children: /* @__PURE__ */ J("button", {
9458
9565
  css: e({
@@ -9481,8 +9588,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
9481
9588
  })] })
9482
9589
  });
9483
9590
  };
9484
- _h.displayName = "Modal";
9485
- var vh = i(({ children: t, ...n }, r) => /* @__PURE__ */ J("div", {
9591
+ vh.displayName = "Modal";
9592
+ var yh = i(({ children: t, ...n }, r) => /* @__PURE__ */ J("div", {
9486
9593
  ref: r,
9487
9594
  css: e({
9488
9595
  padding: "20px 24px 8px",
@@ -9490,7 +9597,7 @@ var vh = i(({ children: t, ...n }, r) => /* @__PURE__ */ J("div", {
9490
9597
  "[data-modal-size=\"lg\"] &": { padding: "24px 24px 12px" }
9491
9598
  }),
9492
9599
  ...n,
9493
- children: /* @__PURE__ */ J(dh, {
9600
+ children: /* @__PURE__ */ J(fh, {
9494
9601
  css: e({
9495
9602
  fontSize: "16px",
9496
9603
  fontWeight: W.weight.bold,
@@ -9502,8 +9609,8 @@ var vh = i(({ children: t, ...n }, r) => /* @__PURE__ */ J("div", {
9502
9609
  children: t
9503
9610
  })
9504
9611
  }));
9505
- vh.displayName = "ModalHeader";
9506
- var yh = i(({ scroll: t = !1, children: n, ...r }, i) => /* @__PURE__ */ J("div", {
9612
+ yh.displayName = "ModalHeader";
9613
+ var bh = i(({ scroll: t = !1, children: n, ...r }, i) => /* @__PURE__ */ J("div", {
9507
9614
  ref: i,
9508
9615
  css: e({
9509
9616
  padding: "0 24px 20px",
@@ -9525,7 +9632,7 @@ var yh = i(({ scroll: t = !1, children: n, ...r }, i) => /* @__PURE__ */ J("div"
9525
9632
  } : {}
9526
9633
  }),
9527
9634
  ...r,
9528
- children: /* @__PURE__ */ J(fh, {
9635
+ children: /* @__PURE__ */ J(ph, {
9529
9636
  asChild: !0,
9530
9637
  children: /* @__PURE__ */ J("div", {
9531
9638
  css: e({
@@ -9538,8 +9645,8 @@ var yh = i(({ scroll: t = !1, children: n, ...r }, i) => /* @__PURE__ */ J("div"
9538
9645
  })
9539
9646
  })
9540
9647
  }));
9541
- yh.displayName = "ModalBody";
9542
- var bh = i(({ children: t, ...n }, r) => /* @__PURE__ */ J("div", {
9648
+ bh.displayName = "ModalBody";
9649
+ var xh = i(({ children: t, ...n }, r) => /* @__PURE__ */ J("div", {
9543
9650
  ref: r,
9544
9651
  css: e({
9545
9652
  display: "flex",
@@ -9554,18 +9661,18 @@ var bh = i(({ children: t, ...n }, r) => /* @__PURE__ */ J("div", {
9554
9661
  ...n,
9555
9662
  children: t
9556
9663
  }));
9557
- bh.displayName = "ModalFooter";
9664
+ xh.displayName = "ModalFooter";
9558
9665
  //#endregion
9559
9666
  //#region src/components/toast/Toast.tsx
9560
- var xh = {
9667
+ var Sh = {
9561
9668
  success: "check-circle",
9562
9669
  error: "error",
9563
9670
  warning: "warning",
9564
9671
  info: "info"
9565
- }, Sh = t`
9672
+ }, Ch = t`
9566
9673
  from { transform: translateX(100%); opacity: 0; }
9567
9674
  to { transform: translateX(0); opacity: 1; }
9568
- `, Ch = i(({ type: t = "success", title: n, description: r, action: i, showClose: a = !0, onClose: o, duration: c = 5e3, ...l }, u) => {
9675
+ `, wh = i(({ type: t = "success", title: n, description: r, action: i, showClose: a = !0, onClose: o, duration: c = 5e3, ...l }, u) => {
9569
9676
  let d = re[t];
9570
9677
  return s(() => {
9571
9678
  if (c > 0 && o) {
@@ -9587,12 +9694,12 @@ var xh = {
9587
9694
  borderRadius: "8px",
9588
9695
  boxShadow: ue.md,
9589
9696
  fontFamily: W.family,
9590
- animation: `${Sh} 200ms ease`
9697
+ animation: `${Ch} 200ms ease`
9591
9698
  }),
9592
9699
  ...l,
9593
9700
  children: [
9594
9701
  /* @__PURE__ */ J(X, {
9595
- name: xh[t],
9702
+ name: Sh[t],
9596
9703
  size: "md",
9597
9704
  color: d.icon,
9598
9705
  css: e({ flexShrink: 0 })
@@ -9663,10 +9770,10 @@ var xh = {
9663
9770
  ]
9664
9771
  });
9665
9772
  });
9666
- Ch.displayName = "Toast";
9773
+ wh.displayName = "Toast";
9667
9774
  //#endregion
9668
9775
  //#region src/components/alert-feed/AlertFeed.tsx
9669
- var wh = {
9776
+ var Th = {
9670
9777
  emergency: {
9671
9778
  label: "Emergency",
9672
9779
  bg: "var(--tag-danger-bg-solid)",
@@ -9687,17 +9794,17 @@ var wh = {
9687
9794
  bg: "var(--tag-info-bg-solid)",
9688
9795
  text: "var(--tag-info-text-solid)"
9689
9796
  }
9690
- }, Th = t`
9797
+ }, Eh = t`
9691
9798
  0%, 100% { opacity: 1; }
9692
9799
  50% { opacity: 0.5; }
9693
- `, Eh = ({ width: t, height: n, radius: r = "4px" }) => /* @__PURE__ */ J("div", { css: e({
9800
+ `, Dh = ({ width: t, height: n, radius: r = "4px" }) => /* @__PURE__ */ J("div", { css: e({
9694
9801
  width: t,
9695
9802
  height: n,
9696
9803
  borderRadius: r,
9697
9804
  background: "#f3f4f6",
9698
- animation: `${Th} 1.5s ease-in-out infinite`
9699
- }) }), Dh = ({ severity: t }) => {
9700
- let n = wh[t];
9805
+ animation: `${Eh} 1.5s ease-in-out infinite`
9806
+ }) }), Oh = ({ severity: t }) => {
9807
+ let n = Th[t];
9701
9808
  return /* @__PURE__ */ J("span", {
9702
9809
  css: e({
9703
9810
  display: "inline-flex",
@@ -9715,7 +9822,7 @@ var wh = {
9715
9822
  }),
9716
9823
  children: n.label
9717
9824
  });
9718
- }, Oh = {
9825
+ }, kh = {
9719
9826
  emergency: {
9720
9827
  bg: "var(--tag-danger-bg-solid)",
9721
9828
  text: "var(--tag-danger-text-solid)"
@@ -9736,11 +9843,11 @@ var wh = {
9736
9843
  bg: "#374151",
9737
9844
  text: "#ffffff"
9738
9845
  }
9739
- }, kh = {
9846
+ }, Ah = {
9740
9847
  bg: "var(--tag-default-bg-subtle)",
9741
9848
  text: "var(--tag-default-text-subtle)"
9742
- }, Ah = ({ label: t, count: n, active: r, filterKey: i }) => {
9743
- let a = r ? Oh[i] ?? kh : kh;
9849
+ }, jh = ({ label: t, count: n, active: r, filterKey: i }) => {
9850
+ let a = r ? kh[i] ?? Ah : Ah;
9744
9851
  return /* @__PURE__ */ J("span", {
9745
9852
  css: e({
9746
9853
  display: "inline-flex",
@@ -9761,7 +9868,7 @@ var wh = {
9761
9868
  }),
9762
9869
  children: `${t} ${n}`
9763
9870
  });
9764
- }, jh = ({ item: t }) => /* @__PURE__ */ Y("div", {
9871
+ }, Mh = ({ item: t }) => /* @__PURE__ */ Y("div", {
9765
9872
  css: e({
9766
9873
  display: "flex",
9767
9874
  flexDirection: "column",
@@ -9779,7 +9886,7 @@ var wh = {
9779
9886
  alignItems: "center",
9780
9887
  justifyContent: "space-between"
9781
9888
  }),
9782
- children: [/* @__PURE__ */ J(Dh, { severity: t.severity }), /* @__PURE__ */ J("span", {
9889
+ children: [/* @__PURE__ */ J(Oh, { severity: t.severity }), /* @__PURE__ */ J("span", {
9783
9890
  css: e({
9784
9891
  fontSize: "12px",
9785
9892
  lineHeight: "18px",
@@ -9810,7 +9917,7 @@ var wh = {
9810
9917
  children: t.meta
9811
9918
  })
9812
9919
  ]
9813
- }), Mh = () => /* @__PURE__ */ Y("div", {
9920
+ }), Nh = () => /* @__PURE__ */ Y("div", {
9814
9921
  css: e({
9815
9922
  display: "flex",
9816
9923
  flexDirection: "column",
@@ -9828,25 +9935,25 @@ var wh = {
9828
9935
  alignItems: "center",
9829
9936
  justifyContent: "space-between"
9830
9937
  }),
9831
- children: [/* @__PURE__ */ J(Eh, {
9938
+ children: [/* @__PURE__ */ J(Dh, {
9832
9939
  width: "72px",
9833
9940
  height: "22px",
9834
9941
  radius: "100px"
9835
- }), /* @__PURE__ */ J(Eh, {
9942
+ }), /* @__PURE__ */ J(Dh, {
9836
9943
  width: "40px",
9837
9944
  height: "12px"
9838
9945
  })]
9839
9946
  }),
9840
- /* @__PURE__ */ J(Eh, {
9947
+ /* @__PURE__ */ J(Dh, {
9841
9948
  width: "80%",
9842
9949
  height: "14px"
9843
9950
  }),
9844
- /* @__PURE__ */ J(Eh, {
9951
+ /* @__PURE__ */ J(Dh, {
9845
9952
  width: "60%",
9846
9953
  height: "12px"
9847
9954
  })
9848
9955
  ]
9849
- }), Nh = i(({ title: t = "Threat Event Alarms", subtitle: n = "(Last 7 Days)", items: r = [], loading: i = !1, height: a = 620, filterCounts: o, activeFilter: s = "all", onFilterChange: c, onViewAll: l, onSettingsClick: u, viewAllLabel: d = "View All Threat Events", ...f }, p) => {
9956
+ }), Ph = i(({ title: t = "Threat Event Alarms", subtitle: n = "(Last 7 Days)", items: r = [], loading: i = !1, height: a = 620, filterCounts: o, activeFilter: s = "all", onFilterChange: c, onViewAll: l, onSettingsClick: u, viewAllLabel: d = "View All Threat Events", ...f }, p) => {
9850
9957
  let m = o ?? {
9851
9958
  all: r.length,
9852
9959
  emergency: r.filter((e) => e.severity === "emergency").length,
@@ -9899,20 +10006,20 @@ var wh = {
9899
10006
  gap: "8px"
9900
10007
  }),
9901
10008
  children: [
9902
- /* @__PURE__ */ J(Eh, {
10009
+ /* @__PURE__ */ J(Dh, {
9903
10010
  width: "16px",
9904
10011
  height: "16px"
9905
10012
  }),
9906
- /* @__PURE__ */ J(Eh, {
10013
+ /* @__PURE__ */ J(Dh, {
9907
10014
  width: "140px",
9908
10015
  height: "16px"
9909
10016
  }),
9910
- /* @__PURE__ */ J(Eh, {
10017
+ /* @__PURE__ */ J(Dh, {
9911
10018
  width: "64px",
9912
10019
  height: "12px"
9913
10020
  })
9914
10021
  ]
9915
- }), /* @__PURE__ */ J(Eh, {
10022
+ }), /* @__PURE__ */ J(Dh, {
9916
10023
  width: "16px",
9917
10024
  height: "16px"
9918
10025
  })]
@@ -9927,7 +10034,7 @@ var wh = {
9927
10034
  52,
9928
10035
  60,
9929
10036
  56
9930
- ].map((e, t) => /* @__PURE__ */ J(Eh, {
10037
+ ].map((e, t) => /* @__PURE__ */ J(Dh, {
9931
10038
  width: `${e}px`,
9932
10039
  height: "24px",
9933
10040
  radius: "100px"
@@ -9990,7 +10097,7 @@ var wh = {
9990
10097
  children: Object.entries(m).map(([t, n]) => /* @__PURE__ */ J("span", {
9991
10098
  onClick: () => c?.(t),
9992
10099
  css: e({ cursor: "pointer" }),
9993
- children: /* @__PURE__ */ J(Ah, {
10100
+ children: /* @__PURE__ */ J(jh, {
9994
10101
  filterKey: t,
9995
10102
  label: _[t] ?? t,
9996
10103
  count: n,
@@ -10021,7 +10128,7 @@ var wh = {
10021
10128
  minHeight: 0,
10022
10129
  overflowY: "auto"
10023
10130
  }),
10024
- children: Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ J(Mh, {}, t))
10131
+ children: Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ J(Nh, {}, t))
10025
10132
  }), /* @__PURE__ */ J("div", {
10026
10133
  css: e({
10027
10134
  display: "flex",
@@ -10029,7 +10136,7 @@ var wh = {
10029
10136
  padding: "8px",
10030
10137
  flexShrink: 0
10031
10138
  }),
10032
- children: /* @__PURE__ */ J(Eh, {
10139
+ children: /* @__PURE__ */ J(Dh, {
10033
10140
  width: "160px",
10034
10141
  height: "16px"
10035
10142
  })
@@ -10134,7 +10241,7 @@ var wh = {
10134
10241
  borderRadius: "2px"
10135
10242
  }
10136
10243
  }),
10137
- children: h.map((e) => /* @__PURE__ */ J(jh, { item: e }, e.id))
10244
+ children: h.map((e) => /* @__PURE__ */ J(Mh, { item: e }, e.id))
10138
10245
  }), l && /* @__PURE__ */ J("button", {
10139
10246
  onClick: l,
10140
10247
  css: e({
@@ -10161,10 +10268,10 @@ var wh = {
10161
10268
  ]
10162
10269
  });
10163
10270
  });
10164
- Nh.displayName = "AlertFeed";
10271
+ Ph.displayName = "AlertFeed";
10165
10272
  //#endregion
10166
10273
  //#region src/tokens/index.ts
10167
- var Ph = {
10274
+ var Fh = {
10168
10275
  button: E,
10169
10276
  checkbox: D,
10170
10277
  radio: O,
@@ -10202,4 +10309,4 @@ var Ph = {
10202
10309
  csc: T
10203
10310
  };
10204
10311
  //#endregion
10205
- export { Nh as AlertFeed, bu as Autocomplete, Em as Avatar, Cl as Badge, gn as Button, wl as Card, Ol as CardAction, Al as CardContent, Dl as CardDescription, jl as CardFooter, Tl as CardHeader, El as CardTitle, pl as Checkbox, up as Dropdown, fp as DropdownItem, Cm as File, X as Icon, yn as Input, ol as InputWithButton, pm as Link, _h as Modal, yh as ModalBody, bh as ModalFooter, vh as ModalHeader, hp as MultiSelect, pp as NotificationBadge, fm as Pagination, bl as Radio, xl as RadioGroup, Ll as Search, al as Select, mm as Table, gm as TableBody, xm as TableCaption, bm as TableCell, ym as TableHead, hm as TableHeader, _m as TableRow, gp as Tabs, Fl as Tag, bn as Textarea, Ch as Toast, Nl as Toggle, cm as Tooltip, ae as avatar, x as base, A as color, T as csc, ve as dataviz, R as dropdown, oe as file, W as font, ge as gray, N as label, te as link, ie as modal, B as multiselect, ee as notificationBadge, U as pagination, le as radius, C as rm, ue as shadow, _e as status, H as table, V as tabs, I as tag, re as toast, Ph as tokens, ce as tooltip };
10312
+ export { Ph as AlertFeed, bu as Autocomplete, Dm as Avatar, Cl as Badge, gn as Button, wl as Card, Ol as CardAction, Al as CardContent, Dl as CardDescription, jl as CardFooter, Tl as CardHeader, El as CardTitle, pl as Checkbox, Sm as DataTable, up as Dropdown, fp as DropdownItem, wm as File, X as Icon, yn as Input, ol as InputWithButton, pm as Link, vh as Modal, bh as ModalBody, xh as ModalFooter, yh as ModalHeader, hp as MultiSelect, pp as NotificationBadge, fm as Pagination, bl as Radio, xl as RadioGroup, Ll as Search, al as Select, mm as Table, gm as TableBody, xm as TableCaption, bm as TableCell, ym as TableHead, hm as TableHeader, _m as TableRow, gp as Tabs, Fl as Tag, bn as Textarea, wh as Toast, Nl as Toggle, cm as Tooltip, ae as avatar, x as base, A as color, T as csc, ve as dataviz, R as dropdown, oe as file, W as font, ge as gray, N as label, te as link, ie as modal, B as multiselect, ee as notificationBadge, U as pagination, le as radius, C as rm, ue as shadow, _e as status, H as table, V as tabs, I as tag, re as toast, Fh as tokens, ce as tooltip };
@@ -20,6 +20,7 @@ export { Pagination, type PaginationProps, type PaginationSize } from './paginat
20
20
  export { Link, type LinkProps, type LinkType } from './link/Link';
21
21
  export { Icon, type IconProps, type IconSize, type IconName } from './icon/Icon';
22
22
  export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, type TableProps, type TableRowProps, type TableHeadProps, type SortDirection } from './table/Table';
23
+ export { DataTable, type DataTableProps, type DataTableColumn } from './table/DataTable';
23
24
  export { File, type FileProps, type FileState } from './file/File';
24
25
  export { Avatar, type AvatarProps, type AvatarSize, type AvatarShape } from './avatar/Avatar';
25
26
  export { Modal, ModalHeader, ModalBody, ModalFooter, type ModalProps, type ModalSize, type ModalHeaderProps, type ModalBodyProps, type ModalFooterProps } from './modal/Modal';
@@ -0,0 +1,28 @@
1
+ import { type ReactNode, type HTMLAttributes } from 'react';
2
+ export interface DataTableColumn<T = Record<string, unknown>> {
3
+ key: string;
4
+ label: string;
5
+ sortable?: boolean;
6
+ filterable?: boolean;
7
+ width?: string;
8
+ align?: 'left' | 'center' | 'right';
9
+ render?: (value: unknown, row: T, index: number) => ReactNode;
10
+ }
11
+ export interface DataTableProps<T = Record<string, unknown>> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
12
+ columns: DataTableColumn<T>[];
13
+ data: T[];
14
+ rowKey?: string | ((row: T, index: number) => string | number);
15
+ striped?: boolean;
16
+ pagination?: boolean;
17
+ pageSize?: number;
18
+ pageSizeOptions?: number[];
19
+ showGoTo?: boolean;
20
+ selectable?: boolean;
21
+ selectedKey?: string | number | null;
22
+ onRowClick?: (row: T, index: number) => void;
23
+ emptyText?: string;
24
+ }
25
+ export declare function DataTable<T extends Record<string, unknown>>({ columns, data, rowKey, striped, pagination, pageSize: initialPageSize, pageSizeOptions, showGoTo, selectable, selectedKey, onRowClick, emptyText, ...rest }: DataTableProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
26
+ export declare namespace DataTable {
27
+ var displayName: string;
28
+ }
@@ -20,6 +20,7 @@ export { Pagination, type PaginationProps, type PaginationSize } from "./compone
20
20
  export { Link, type LinkProps, type LinkType } from "./components/link/Link";
21
21
  export { Icon, type IconProps, type IconSize, type IconName } from "./components/icon/Icon";
22
22
  export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, type TableProps, type TableRowProps, type TableHeadProps, type SortDirection } from "./components/table/Table";
23
+ export { DataTable, type DataTableProps, type DataTableColumn } from "./components/table/DataTable";
23
24
  export { File, type FileProps, type FileState } from "./components/file/File";
24
25
  export { Avatar, type AvatarProps, type AvatarSize, type AvatarShape } from "./components/avatar/Avatar";
25
26
  export { Modal, ModalHeader, ModalBody, ModalFooter, type ModalProps, type ModalSize, type ModalHeaderProps, type ModalBodyProps, type ModalFooterProps } from "./components/modal/Modal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimkihwan/cytur-design-system",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",