@sarunyu/system-one 4.2.0 → 4.2.2

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.cjs CHANGED
@@ -3430,25 +3430,46 @@ const ALERT_CONFIG = {
3430
3430
  titleColor: "var(--accent-orange)",
3431
3431
  background: "https://www.figma.com/api/mcp/asset/f4ca68ad-5732-4124-9ff4-cfb69330cc02",
3432
3432
  layers: [
3433
- { inset: "12.5%", src: "https://www.figma.com/api/mcp/asset/7052a092-a432-4e8c-b559-6b51d28d878f" },
3434
- { inset: "22.5%", src: "https://www.figma.com/api/mcp/asset/a291a1b2-06c8-455c-8e21-29755aa05c57" },
3435
- { inset: "28.57% 30.71% 32.86% 30.71%", src: "https://www.figma.com/api/mcp/asset/a22c7520-55fe-4003-ba78-65dab40b9e23" }
3433
+ {
3434
+ inset: "12.5%",
3435
+ src: "https://www.figma.com/api/mcp/asset/7052a092-a432-4e8c-b559-6b51d28d878f"
3436
+ },
3437
+ {
3438
+ inset: "22.5%",
3439
+ src: "https://www.figma.com/api/mcp/asset/a291a1b2-06c8-455c-8e21-29755aa05c57"
3440
+ },
3441
+ {
3442
+ inset: "28.57% 30.71% 32.86% 30.71%",
3443
+ src: "https://www.figma.com/api/mcp/asset/a22c7520-55fe-4003-ba78-65dab40b9e23"
3444
+ }
3436
3445
  ]
3437
3446
  },
3438
3447
  success: {
3439
3448
  titleColor: "var(--success)",
3440
3449
  background: "https://www.figma.com/api/mcp/asset/2a865e6f-8a92-4496-88b5-71ac99e2c385",
3441
3450
  layers: [
3442
- { inset: "12.77%", src: "https://www.figma.com/api/mcp/asset/5878ce35-4f9a-4203-97a8-70a2f17b182c" },
3443
- { inset: "22.55%", src: "https://www.figma.com/api/mcp/asset/cea74180-b261-4db7-8712-6d32c4ccdeaf" }
3451
+ {
3452
+ inset: "12.77%",
3453
+ src: "https://www.figma.com/api/mcp/asset/5878ce35-4f9a-4203-97a8-70a2f17b182c"
3454
+ },
3455
+ {
3456
+ inset: "22.55%",
3457
+ src: "https://www.figma.com/api/mcp/asset/cea74180-b261-4db7-8712-6d32c4ccdeaf"
3458
+ }
3444
3459
  ]
3445
3460
  },
3446
3461
  danger: {
3447
3462
  titleColor: "var(--destructive)",
3448
3463
  background: "https://www.figma.com/api/mcp/asset/c7a65595-684e-4a04-b7fd-d443951f680a",
3449
3464
  layers: [
3450
- { inset: "12.77%", src: "https://www.figma.com/api/mcp/asset/10090345-ae32-4fc4-aff6-cba04ea93700" },
3451
- { inset: "22.55%", src: "https://www.figma.com/api/mcp/asset/3aa1156e-e48b-411f-ab98-93e1da98ecc1" }
3465
+ {
3466
+ inset: "12.77%",
3467
+ src: "https://www.figma.com/api/mcp/asset/10090345-ae32-4fc4-aff6-cba04ea93700"
3468
+ },
3469
+ {
3470
+ inset: "22.55%",
3471
+ src: "https://www.figma.com/api/mcp/asset/3aa1156e-e48b-411f-ab98-93e1da98ecc1"
3472
+ }
3452
3473
  ]
3453
3474
  }
3454
3475
  };
@@ -3470,32 +3491,42 @@ function Modal({
3470
3491
  }) {
3471
3492
  const isContent = variant === "content";
3472
3493
  const isAlert = variant === "alert";
3494
+ const isDialog = variant === "dialog";
3473
3495
  const isDesktop = responsive === "desktop";
3474
3496
  const alert = ALERT_CONFIG[alertStatus];
3475
3497
  return /* @__PURE__ */ jsxRuntime.jsxs(
3476
3498
  "div",
3477
3499
  {
3478
3500
  className: cn(
3479
- "max-w-full overflow-hidden border border-border bg-background",
3501
+ "w-auto overflow-hidden border border-border bg-background",
3480
3502
  isAlert ? "w-[343px] rounded-2xl" : "rounded-xl",
3481
- isContent ? "w-[343px]" : isAlert ? void 0 : "w-[375px]",
3503
+ isContent ? "min-w-[343px] max-w-[500px] " : isAlert ? void 0 : isDialog && "min-w-[375px] max-w-[500px]",
3482
3504
  className
3483
3505
  ),
3484
3506
  children: [
3485
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center px-4 pt-4", isAlert ? "justify-end" : "justify-between gap-4"), children: [
3486
- !isAlert ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[18px] leading-7 font-bold text-foreground", children: title }) : null,
3487
- showClose ? /* @__PURE__ */ jsxRuntime.jsx(
3488
- Button,
3489
- {
3490
- "aria-label": "Close dialog",
3491
- className: "h-5 w-5 shrink-0 rounded-none text-subtle-text",
3492
- onClick: onClose,
3493
- size: "icon-xs",
3494
- variant: "plain-black",
3495
- children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 20, weight: "regular" })
3496
- }
3497
- ) : null
3498
- ] }),
3507
+ /* @__PURE__ */ jsxRuntime.jsxs(
3508
+ "div",
3509
+ {
3510
+ className: cn(
3511
+ "flex items-center px-4 pt-4",
3512
+ isAlert ? "justify-end" : "justify-between gap-4"
3513
+ ),
3514
+ children: [
3515
+ !isAlert ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[18px] leading-7 font-bold text-foreground", children: title }) : null,
3516
+ showClose ? /* @__PURE__ */ jsxRuntime.jsx(
3517
+ Button,
3518
+ {
3519
+ "aria-label": "Close dialog",
3520
+ className: "h-5 w-5 shrink-0 rounded-none text-subtle-text",
3521
+ onClick: onClose,
3522
+ size: "icon-xs",
3523
+ variant: "plain-black",
3524
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 20, weight: "regular" })
3525
+ }
3526
+ ) : null
3527
+ ]
3528
+ }
3529
+ ),
3499
3530
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("px-4 pb-6", isAlert ? "pt-0" : "pt-4"), children: isAlert ? /* @__PURE__ */ jsxRuntime.jsx(AlertBody, { config: alert, title, description }) : isContent ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: children ?? null }) : children ?? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm leading-5 text-muted-foreground", children: description }) }),
3500
3531
  actionLayout !== "none" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 pb-4", children: /* @__PURE__ */ jsxRuntime.jsx(
3501
3532
  ModalActions,
@@ -3520,11 +3551,40 @@ function AlertBody({
3520
3551
  }) {
3521
3552
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-4 text-center", children: [
3522
3553
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative size-[100px]", children: [
3523
- /* @__PURE__ */ jsxRuntime.jsx("img", { alt: "", className: "absolute inset-0 size-full", src: config.background }),
3524
- config.layers.map((layer) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute", style: { inset: layer.inset }, children: /* @__PURE__ */ jsxRuntime.jsx("img", { alt: "", className: "absolute inset-0 size-full", src: layer.src }) }, layer.src))
3554
+ /* @__PURE__ */ jsxRuntime.jsx(
3555
+ "img",
3556
+ {
3557
+ alt: "",
3558
+ className: "absolute inset-0 size-full",
3559
+ src: config.background
3560
+ }
3561
+ ),
3562
+ config.layers.map((layer) => /* @__PURE__ */ jsxRuntime.jsx(
3563
+ "div",
3564
+ {
3565
+ className: "absolute",
3566
+ style: { inset: layer.inset },
3567
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3568
+ "img",
3569
+ {
3570
+ alt: "",
3571
+ className: "absolute inset-0 size-full",
3572
+ src: layer.src
3573
+ }
3574
+ )
3575
+ },
3576
+ layer.src
3577
+ ))
3525
3578
  ] }),
3526
3579
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
3527
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[18px] leading-7 font-bold", style: { color: config.titleColor }, children: title }),
3580
+ /* @__PURE__ */ jsxRuntime.jsx(
3581
+ "p",
3582
+ {
3583
+ className: "text-[18px] leading-7 font-bold",
3584
+ style: { color: config.titleColor },
3585
+ children: title
3586
+ }
3587
+ ),
3528
3588
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm leading-5 text-muted-foreground", children: description })
3529
3589
  ] })
3530
3590
  ] });
@@ -3554,8 +3614,26 @@ function ModalActions({
3554
3614
  const containerClass = isContent ? cn("flex gap-4", isDesktop ? "justify-end" : "flex-col") : "flex items-center gap-4";
3555
3615
  const buttonClass = isContent ? isDesktop ? void 0 : "w-full" : "min-w-0 flex-1";
3556
3616
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: containerClass, children: [
3557
- /* @__PURE__ */ jsxRuntime.jsx(Button, { className: buttonClass, onClick: onSecondaryClick, size: "xl", variant: "outline", children: secondaryLabel }),
3558
- /* @__PURE__ */ jsxRuntime.jsx(Button, { className: buttonClass, onClick: onPrimaryClick, size: "xl", variant: "primary", children: primaryLabel })
3617
+ /* @__PURE__ */ jsxRuntime.jsx(
3618
+ Button,
3619
+ {
3620
+ className: buttonClass,
3621
+ onClick: onSecondaryClick,
3622
+ size: "xl",
3623
+ variant: "outline",
3624
+ children: secondaryLabel
3625
+ }
3626
+ ),
3627
+ /* @__PURE__ */ jsxRuntime.jsx(
3628
+ Button,
3629
+ {
3630
+ className: buttonClass,
3631
+ onClick: onPrimaryClick,
3632
+ size: "xl",
3633
+ variant: "primary",
3634
+ children: primaryLabel
3635
+ }
3636
+ )
3559
3637
  ] });
3560
3638
  }
3561
3639
  const OptionList = React.forwardRef(