@designa8/vibedesign-monday-com-internal-v1-2-176b 0.0.2 → 0.1.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/README.md +1 -1
- package/dist/index.cjs +78 -53
- package/dist/index.js +78 -53
- package/dist/styles.css +7 -0
- package/package.json +1 -1
- package/src/atoms/Icon/icons.data.ts +1 -0
- package/src/atoms/Modal/Modal.tsx +87 -40
- package/src/atoms/Modal/preview.tsx +58 -1
- package/src/tokens.css +1 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-monday-com-internal-v1-2-176b
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.1.1**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -251,7 +251,8 @@ var ICON_REGISTRY = {
|
|
|
251
251
|
"inbox": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M22 12h-6l-2 3h-4l-2-3H2" }, { tag: "path", d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }] },
|
|
252
252
|
"arrow-up-down": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "m21 16-4 4-4-4" }, { tag: "path", d: "M17 20V4" }, { tag: "path", d: "m3 8 4-4 4 4" }, { tag: "path", d: "M7 4v16" }] },
|
|
253
253
|
"upload": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 3v12" }, { tag: "path", d: "m17 8-5-5-5 5" }, { tag: "path", d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }] },
|
|
254
|
-
"filter-x": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055" }, { tag: "path", d: "m22 3-5 5" }, { tag: "path", d: "m17 3 5 5" }] }
|
|
254
|
+
"filter-x": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055" }, { tag: "path", d: "m22 3-5 5" }, { tag: "path", d: "m17 3 5 5" }] },
|
|
255
|
+
"trash": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M3 6h18" }, { tag: "path", d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }, { tag: "path", d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }] }
|
|
255
256
|
};
|
|
256
257
|
|
|
257
258
|
// virtual-pkg:src/atoms/Icon/Icon.tsx
|
|
@@ -6505,6 +6506,8 @@ var Modal = React55.forwardRef(
|
|
|
6505
6506
|
closeLabel = "Close dialog",
|
|
6506
6507
|
closeOnScrim = true,
|
|
6507
6508
|
bodyClassName,
|
|
6509
|
+
placement = "center",
|
|
6510
|
+
size = "md",
|
|
6508
6511
|
className,
|
|
6509
6512
|
children,
|
|
6510
6513
|
"aria-label": ariaLabel,
|
|
@@ -6546,11 +6549,14 @@ var Modal = React55.forwardRef(
|
|
|
6546
6549
|
};
|
|
6547
6550
|
if (!mounted) return null;
|
|
6548
6551
|
const state = open ? "open" : "closed";
|
|
6552
|
+
const isTop = placement === "top";
|
|
6553
|
+
const hasHeader = Boolean(icon || title || description || !hideClose);
|
|
6549
6554
|
return (0, import_react_dom5.createPortal)(
|
|
6550
6555
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
6551
6556
|
"div",
|
|
6552
6557
|
{
|
|
6553
6558
|
"data-state": state,
|
|
6559
|
+
"data-placement": placement,
|
|
6554
6560
|
"aria-hidden": open ? void 0 : true,
|
|
6555
6561
|
className: "fixed inset-0 overflow-hidden data-[state=closed]:pointer-events-none",
|
|
6556
6562
|
style: { zIndex: "var(--z-modal, 1200)" },
|
|
@@ -6564,68 +6570,87 @@ var Modal = React55.forwardRef(
|
|
|
6564
6570
|
className: "fixed inset-0 bg-scrim/40 transition-opacity duration-200 ease-out data-[state=closed]:opacity-0 data-[state=open]:opacity-100"
|
|
6565
6571
|
}
|
|
6566
6572
|
),
|
|
6567
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6573
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6568
6574
|
"div",
|
|
6569
6575
|
{
|
|
6570
|
-
ref:
|
|
6571
|
-
role: "dialog",
|
|
6572
|
-
"aria-modal": "true",
|
|
6573
|
-
"aria-labelledby": title ? titleId : void 0,
|
|
6574
|
-
"aria-label": title ? void 0 : ariaLabel ?? "Dialog",
|
|
6575
|
-
"aria-describedby": description ? descId : void 0,
|
|
6576
|
-
"data-state": state,
|
|
6576
|
+
ref: wrapRef,
|
|
6577
6577
|
className: cn49(
|
|
6578
|
-
"
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
className
|
|
6578
|
+
"fixed inset-0 flex justify-center",
|
|
6579
|
+
isTop ? (
|
|
6580
|
+
// Pinned near the top at every breakpoint — never bottom-aligned.
|
|
6581
|
+
"items-start px-base pt-[12dvh] pb-base"
|
|
6582
|
+
) : "items-end p-base sm:items-center"
|
|
6584
6583
|
),
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6584
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
6585
|
+
"div",
|
|
6586
|
+
{
|
|
6587
|
+
ref: setRefs,
|
|
6588
|
+
role: "dialog",
|
|
6589
|
+
"aria-modal": "true",
|
|
6590
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
6591
|
+
"aria-label": title ? void 0 : ariaLabel ?? "Dialog",
|
|
6592
|
+
"aria-describedby": description ? descId : void 0,
|
|
6593
|
+
"data-state": state,
|
|
6594
|
+
"data-placement": placement,
|
|
6595
|
+
className: cn49(
|
|
6596
|
+
"relative flex max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-lg border border-hairline-soft bg-canvas text-ink shadow-modal",
|
|
6597
|
+
size === "lg" ? "sm:w-[var(--container-palette,40rem)]" : "sm:w-[var(--container-modal,32rem)]",
|
|
6598
|
+
"transition-[transform,translate,scale,opacity,visibility] duration-200 ease-out",
|
|
6599
|
+
"data-[state=open]:visible data-[state=open]:translate-y-0 data-[state=open]:scale-100 data-[state=open]:opacity-100",
|
|
6600
|
+
isTop ? "data-[state=closed]:-translate-y-2 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0" : "data-[state=closed]:translate-y-2 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0",
|
|
6601
|
+
"data-[state=closed]:invisible",
|
|
6602
|
+
className
|
|
6603
|
+
),
|
|
6604
|
+
...rest,
|
|
6605
|
+
children: [
|
|
6606
|
+
hasHeader ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex shrink-0 items-start justify-between gap-md px-lg pt-lg", children: [
|
|
6607
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex min-w-0 flex-col gap-xs", children: [
|
|
6608
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6609
|
+
"span",
|
|
6610
|
+
{
|
|
6611
|
+
"aria-hidden": "true",
|
|
6612
|
+
className: cn49(
|
|
6613
|
+
"mb-xs inline-flex size-12 items-center justify-center rounded-md",
|
|
6614
|
+
tone === "danger" ? "bg-semantic-error-soft text-semantic-error" : "bg-primary-soft text-primary"
|
|
6615
|
+
),
|
|
6616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { name: icon, size: 26 })
|
|
6617
|
+
}
|
|
6618
|
+
) : null,
|
|
6619
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h2", { id: titleId, className: "text-heading-md text-ink", children: title }) : null,
|
|
6620
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { id: descId, className: "text-body-md text-body", children: description }) : null
|
|
6621
|
+
] }),
|
|
6622
|
+
!hideClose && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6623
|
+
IconButton,
|
|
6624
|
+
{
|
|
6625
|
+
icon: "x",
|
|
6626
|
+
variant: "ghost",
|
|
6627
|
+
size: "sm",
|
|
6628
|
+
"aria-label": closeLabel,
|
|
6629
|
+
onClick: () => onOpenChange(false)
|
|
6630
|
+
}
|
|
6631
|
+
)
|
|
6632
|
+
] }) : null,
|
|
6633
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6634
|
+
"div",
|
|
6591
6635
|
{
|
|
6592
|
-
"aria-hidden": "true",
|
|
6593
6636
|
className: cn49(
|
|
6594
|
-
"
|
|
6595
|
-
|
|
6637
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
6638
|
+
hasHeader ? cn49("px-lg", children ? "pt-base pb-lg" : "pb-base") : bodyClassName ? (
|
|
6639
|
+
// Chromeless panel: the caller owns the body padding (e.g. a palette
|
|
6640
|
+
// that pins its own search row and scrolls only the results).
|
|
6641
|
+
void 0
|
|
6642
|
+
) : "p-lg",
|
|
6643
|
+
bodyClassName
|
|
6596
6644
|
),
|
|
6597
|
-
children
|
|
6645
|
+
children
|
|
6598
6646
|
}
|
|
6599
|
-
) : null,
|
|
6600
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h2", { id: titleId, className: "text-heading-md text-ink", children: title }) : null,
|
|
6601
|
-
description ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { id: descId, className: "text-body-md text-body", children: description }) : null
|
|
6602
|
-
] }),
|
|
6603
|
-
!hideClose && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6604
|
-
IconButton,
|
|
6605
|
-
{
|
|
6606
|
-
icon: "x",
|
|
6607
|
-
variant: "ghost",
|
|
6608
|
-
size: "sm",
|
|
6609
|
-
"aria-label": closeLabel,
|
|
6610
|
-
onClick: () => onOpenChange(false)
|
|
6611
|
-
}
|
|
6612
|
-
)
|
|
6613
|
-
] }),
|
|
6614
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6615
|
-
"div",
|
|
6616
|
-
{
|
|
6617
|
-
className: cn49(
|
|
6618
|
-
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-lg",
|
|
6619
|
-
children ? "pt-base pb-lg" : "pb-base",
|
|
6620
|
-
bodyClassName
|
|
6621
6647
|
),
|
|
6622
|
-
children
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
]
|
|
6648
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { "data-modal-footer": "", className: "flex shrink-0 items-center justify-end gap-sm px-lg pb-lg", children: footer }) : null
|
|
6649
|
+
]
|
|
6650
|
+
}
|
|
6651
|
+
)
|
|
6627
6652
|
}
|
|
6628
|
-
)
|
|
6653
|
+
)
|
|
6629
6654
|
]
|
|
6630
6655
|
}
|
|
6631
6656
|
),
|
package/dist/index.js
CHANGED
|
@@ -127,7 +127,8 @@ var ICON_REGISTRY = {
|
|
|
127
127
|
"inbox": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M22 12h-6l-2 3h-4l-2-3H2" }, { tag: "path", d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }] },
|
|
128
128
|
"arrow-up-down": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "m21 16-4 4-4-4" }, { tag: "path", d: "M17 20V4" }, { tag: "path", d: "m3 8 4-4 4 4" }, { tag: "path", d: "M7 4v16" }] },
|
|
129
129
|
"upload": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 3v12" }, { tag: "path", d: "m17 8-5-5-5 5" }, { tag: "path", d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }] },
|
|
130
|
-
"filter-x": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055" }, { tag: "path", d: "m22 3-5 5" }, { tag: "path", d: "m17 3 5 5" }] }
|
|
130
|
+
"filter-x": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055" }, { tag: "path", d: "m22 3-5 5" }, { tag: "path", d: "m17 3 5 5" }] },
|
|
131
|
+
"trash": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M3 6h18" }, { tag: "path", d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }, { tag: "path", d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }] }
|
|
131
132
|
};
|
|
132
133
|
|
|
133
134
|
// virtual-pkg:src/atoms/Icon/Icon.tsx
|
|
@@ -6381,6 +6382,8 @@ var Modal = React55.forwardRef(
|
|
|
6381
6382
|
closeLabel = "Close dialog",
|
|
6382
6383
|
closeOnScrim = true,
|
|
6383
6384
|
bodyClassName,
|
|
6385
|
+
placement = "center",
|
|
6386
|
+
size = "md",
|
|
6384
6387
|
className,
|
|
6385
6388
|
children,
|
|
6386
6389
|
"aria-label": ariaLabel,
|
|
@@ -6422,11 +6425,14 @@ var Modal = React55.forwardRef(
|
|
|
6422
6425
|
};
|
|
6423
6426
|
if (!mounted) return null;
|
|
6424
6427
|
const state = open ? "open" : "closed";
|
|
6428
|
+
const isTop = placement === "top";
|
|
6429
|
+
const hasHeader = Boolean(icon || title || description || !hideClose);
|
|
6425
6430
|
return createPortal5(
|
|
6426
6431
|
/* @__PURE__ */ jsxs52(
|
|
6427
6432
|
"div",
|
|
6428
6433
|
{
|
|
6429
6434
|
"data-state": state,
|
|
6435
|
+
"data-placement": placement,
|
|
6430
6436
|
"aria-hidden": open ? void 0 : true,
|
|
6431
6437
|
className: "fixed inset-0 overflow-hidden data-[state=closed]:pointer-events-none",
|
|
6432
6438
|
style: { zIndex: "var(--z-modal, 1200)" },
|
|
@@ -6440,68 +6446,87 @@ var Modal = React55.forwardRef(
|
|
|
6440
6446
|
className: "fixed inset-0 bg-scrim/40 transition-opacity duration-200 ease-out data-[state=closed]:opacity-0 data-[state=open]:opacity-100"
|
|
6441
6447
|
}
|
|
6442
6448
|
),
|
|
6443
|
-
/* @__PURE__ */ jsx55(
|
|
6449
|
+
/* @__PURE__ */ jsx55(
|
|
6444
6450
|
"div",
|
|
6445
6451
|
{
|
|
6446
|
-
ref:
|
|
6447
|
-
role: "dialog",
|
|
6448
|
-
"aria-modal": "true",
|
|
6449
|
-
"aria-labelledby": title ? titleId : void 0,
|
|
6450
|
-
"aria-label": title ? void 0 : ariaLabel ?? "Dialog",
|
|
6451
|
-
"aria-describedby": description ? descId : void 0,
|
|
6452
|
-
"data-state": state,
|
|
6452
|
+
ref: wrapRef,
|
|
6453
6453
|
className: cn49(
|
|
6454
|
-
"
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
className
|
|
6454
|
+
"fixed inset-0 flex justify-center",
|
|
6455
|
+
isTop ? (
|
|
6456
|
+
// Pinned near the top at every breakpoint — never bottom-aligned.
|
|
6457
|
+
"items-start px-base pt-[12dvh] pb-base"
|
|
6458
|
+
) : "items-end p-base sm:items-center"
|
|
6460
6459
|
),
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6460
|
+
children: /* @__PURE__ */ jsxs52(
|
|
6461
|
+
"div",
|
|
6462
|
+
{
|
|
6463
|
+
ref: setRefs,
|
|
6464
|
+
role: "dialog",
|
|
6465
|
+
"aria-modal": "true",
|
|
6466
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
6467
|
+
"aria-label": title ? void 0 : ariaLabel ?? "Dialog",
|
|
6468
|
+
"aria-describedby": description ? descId : void 0,
|
|
6469
|
+
"data-state": state,
|
|
6470
|
+
"data-placement": placement,
|
|
6471
|
+
className: cn49(
|
|
6472
|
+
"relative flex max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-lg border border-hairline-soft bg-canvas text-ink shadow-modal",
|
|
6473
|
+
size === "lg" ? "sm:w-[var(--container-palette,40rem)]" : "sm:w-[var(--container-modal,32rem)]",
|
|
6474
|
+
"transition-[transform,translate,scale,opacity,visibility] duration-200 ease-out",
|
|
6475
|
+
"data-[state=open]:visible data-[state=open]:translate-y-0 data-[state=open]:scale-100 data-[state=open]:opacity-100",
|
|
6476
|
+
isTop ? "data-[state=closed]:-translate-y-2 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0" : "data-[state=closed]:translate-y-2 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0",
|
|
6477
|
+
"data-[state=closed]:invisible",
|
|
6478
|
+
className
|
|
6479
|
+
),
|
|
6480
|
+
...rest,
|
|
6481
|
+
children: [
|
|
6482
|
+
hasHeader ? /* @__PURE__ */ jsxs52("div", { className: "flex shrink-0 items-start justify-between gap-md px-lg pt-lg", children: [
|
|
6483
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex min-w-0 flex-col gap-xs", children: [
|
|
6484
|
+
icon ? /* @__PURE__ */ jsx55(
|
|
6485
|
+
"span",
|
|
6486
|
+
{
|
|
6487
|
+
"aria-hidden": "true",
|
|
6488
|
+
className: cn49(
|
|
6489
|
+
"mb-xs inline-flex size-12 items-center justify-center rounded-md",
|
|
6490
|
+
tone === "danger" ? "bg-semantic-error-soft text-semantic-error" : "bg-primary-soft text-primary"
|
|
6491
|
+
),
|
|
6492
|
+
children: /* @__PURE__ */ jsx55(Icon, { name: icon, size: 26 })
|
|
6493
|
+
}
|
|
6494
|
+
) : null,
|
|
6495
|
+
title ? /* @__PURE__ */ jsx55("h2", { id: titleId, className: "text-heading-md text-ink", children: title }) : null,
|
|
6496
|
+
description ? /* @__PURE__ */ jsx55("p", { id: descId, className: "text-body-md text-body", children: description }) : null
|
|
6497
|
+
] }),
|
|
6498
|
+
!hideClose && /* @__PURE__ */ jsx55(
|
|
6499
|
+
IconButton,
|
|
6500
|
+
{
|
|
6501
|
+
icon: "x",
|
|
6502
|
+
variant: "ghost",
|
|
6503
|
+
size: "sm",
|
|
6504
|
+
"aria-label": closeLabel,
|
|
6505
|
+
onClick: () => onOpenChange(false)
|
|
6506
|
+
}
|
|
6507
|
+
)
|
|
6508
|
+
] }) : null,
|
|
6509
|
+
/* @__PURE__ */ jsx55(
|
|
6510
|
+
"div",
|
|
6467
6511
|
{
|
|
6468
|
-
"aria-hidden": "true",
|
|
6469
6512
|
className: cn49(
|
|
6470
|
-
"
|
|
6471
|
-
|
|
6513
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
6514
|
+
hasHeader ? cn49("px-lg", children ? "pt-base pb-lg" : "pb-base") : bodyClassName ? (
|
|
6515
|
+
// Chromeless panel: the caller owns the body padding (e.g. a palette
|
|
6516
|
+
// that pins its own search row and scrolls only the results).
|
|
6517
|
+
void 0
|
|
6518
|
+
) : "p-lg",
|
|
6519
|
+
bodyClassName
|
|
6472
6520
|
),
|
|
6473
|
-
children
|
|
6521
|
+
children
|
|
6474
6522
|
}
|
|
6475
|
-
) : null,
|
|
6476
|
-
title ? /* @__PURE__ */ jsx55("h2", { id: titleId, className: "text-heading-md text-ink", children: title }) : null,
|
|
6477
|
-
description ? /* @__PURE__ */ jsx55("p", { id: descId, className: "text-body-md text-body", children: description }) : null
|
|
6478
|
-
] }),
|
|
6479
|
-
!hideClose && /* @__PURE__ */ jsx55(
|
|
6480
|
-
IconButton,
|
|
6481
|
-
{
|
|
6482
|
-
icon: "x",
|
|
6483
|
-
variant: "ghost",
|
|
6484
|
-
size: "sm",
|
|
6485
|
-
"aria-label": closeLabel,
|
|
6486
|
-
onClick: () => onOpenChange(false)
|
|
6487
|
-
}
|
|
6488
|
-
)
|
|
6489
|
-
] }),
|
|
6490
|
-
/* @__PURE__ */ jsx55(
|
|
6491
|
-
"div",
|
|
6492
|
-
{
|
|
6493
|
-
className: cn49(
|
|
6494
|
-
"min-h-0 flex-1 overflow-y-auto overscroll-contain px-lg",
|
|
6495
|
-
children ? "pt-base pb-lg" : "pb-base",
|
|
6496
|
-
bodyClassName
|
|
6497
6523
|
),
|
|
6498
|
-
children
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
]
|
|
6524
|
+
footer ? /* @__PURE__ */ jsx55("div", { "data-modal-footer": "", className: "flex shrink-0 items-center justify-end gap-sm px-lg pb-lg", children: footer }) : null
|
|
6525
|
+
]
|
|
6526
|
+
}
|
|
6527
|
+
)
|
|
6503
6528
|
}
|
|
6504
|
-
)
|
|
6529
|
+
)
|
|
6505
6530
|
]
|
|
6506
6531
|
}
|
|
6507
6532
|
),
|
package/dist/styles.css
CHANGED
|
@@ -139,6 +139,7 @@
|
|
|
139
139
|
--spacing-gutter: 24px;
|
|
140
140
|
--container-drawer: 28rem;
|
|
141
141
|
--container-modal: 32rem;
|
|
142
|
+
--container-palette: 40rem;
|
|
142
143
|
--grid-template-columns-system: repeat(12, minmax(0, 1fr));
|
|
143
144
|
}
|
|
144
145
|
}
|
|
@@ -319,6 +320,9 @@
|
|
|
319
320
|
.relative {
|
|
320
321
|
position: relative;
|
|
321
322
|
}
|
|
323
|
+
.sticky {
|
|
324
|
+
position: sticky;
|
|
325
|
+
}
|
|
322
326
|
.inset-0 {
|
|
323
327
|
inset: 0;
|
|
324
328
|
}
|
|
@@ -334,6 +338,9 @@
|
|
|
334
338
|
.-top-lg {
|
|
335
339
|
top: calc(var(--spacing-lg) * -1);
|
|
336
340
|
}
|
|
341
|
+
.top-0 {
|
|
342
|
+
top: 0;
|
|
343
|
+
}
|
|
337
344
|
.top-1\/2 {
|
|
338
345
|
top: calc(1 / 2 * 100%);
|
|
339
346
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designa8/vibedesign-monday-com-internal-v1-2-176b",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Complete design system \"My Project monday.com-internal-v1\" generated by Atoms Design.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -112,6 +112,7 @@ export const ICON_REGISTRY = {
|
|
|
112
112
|
"arrow-up-down": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "m21 16-4 4-4-4" }, { tag: "path", d: "M17 20V4" }, { tag: "path", d: "m3 8 4-4 4 4" }, { tag: "path", d: "M7 4v16" }] },
|
|
113
113
|
"upload": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 3v12" }, { tag: "path", d: "m17 8-5-5-5 5" }, { tag: "path", d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }] },
|
|
114
114
|
"filter-x": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055" }, { tag: "path", d: "m22 3-5 5" }, { tag: "path", d: "m17 3 5 5" }] },
|
|
115
|
+
"trash": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M3 6h18" }, { tag: "path", d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }, { tag: "path", d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }] },
|
|
115
116
|
} as const;
|
|
116
117
|
|
|
117
118
|
export type IconName = keyof typeof ICON_REGISTRY;
|
|
@@ -5,6 +5,12 @@ import { Icon, type IconName } from "../Icon";
|
|
|
5
5
|
|
|
6
6
|
export type ModalTone = "default" | "danger";
|
|
7
7
|
|
|
8
|
+
/** `center` is the classic dialog. `top` pins the panel near the top of the viewport (command palette). */
|
|
9
|
+
export type ModalPlacement = "center" | "top";
|
|
10
|
+
|
|
11
|
+
/** `md` is the standard dialog width, `lg` the wider palette width. */
|
|
12
|
+
export type ModalSize = "md" | "lg";
|
|
13
|
+
|
|
8
14
|
export interface ModalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
9
15
|
/** Controlled open state. */
|
|
10
16
|
open: boolean;
|
|
@@ -29,6 +35,16 @@ export interface ModalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "
|
|
|
29
35
|
closeOnScrim?: boolean;
|
|
30
36
|
/** Extra classes for the scrolling body. */
|
|
31
37
|
bodyClassName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Vertical anchoring of the panel. `center` (default) is a classic dialog;
|
|
40
|
+
* `top` sits about 12vh from the top at every breakpoint, for a command palette.
|
|
41
|
+
*/
|
|
42
|
+
placement?: ModalPlacement;
|
|
43
|
+
/**
|
|
44
|
+
* Panel width. `md` (default) is the standard dialog width; `lg` uses the wider
|
|
45
|
+
* palette width from `sm` up (full width below `sm`).
|
|
46
|
+
*/
|
|
47
|
+
size?: ModalSize;
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
const cn = (...parts: Array<string | false | null | undefined>) =>
|
|
@@ -48,6 +64,8 @@ export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
|
48
64
|
closeLabel = "Close dialog",
|
|
49
65
|
closeOnScrim = true,
|
|
50
66
|
bodyClassName,
|
|
67
|
+
placement = "center",
|
|
68
|
+
size = "md",
|
|
51
69
|
className,
|
|
52
70
|
children,
|
|
53
71
|
"aria-label": ariaLabel,
|
|
@@ -100,10 +118,16 @@ export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
|
100
118
|
|
|
101
119
|
if (!mounted) return null;
|
|
102
120
|
const state = open ? "open" : "closed";
|
|
121
|
+
const isTop = placement === "top";
|
|
122
|
+
|
|
123
|
+
// A header row is only rendered when it actually has something in it, so a
|
|
124
|
+
// chromeless panel (palette body, media) starts flush at the top edge.
|
|
125
|
+
const hasHeader = Boolean(icon || title || description || !hideClose);
|
|
103
126
|
|
|
104
127
|
return createPortal(
|
|
105
128
|
<div
|
|
106
129
|
data-state={state}
|
|
130
|
+
data-placement={placement}
|
|
107
131
|
aria-hidden={open ? undefined : true}
|
|
108
132
|
className="fixed inset-0 overflow-hidden data-[state=closed]:pointer-events-none"
|
|
109
133
|
style={{ zIndex: "var(--z-modal, 1200)" }}
|
|
@@ -114,7 +138,16 @@ export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
|
114
138
|
data-state={state}
|
|
115
139
|
className="fixed inset-0 bg-scrim/40 transition-opacity duration-200 ease-out data-[state=closed]:opacity-0 data-[state=open]:opacity-100"
|
|
116
140
|
/>
|
|
117
|
-
<div
|
|
141
|
+
<div
|
|
142
|
+
ref={wrapRef}
|
|
143
|
+
className={cn(
|
|
144
|
+
"fixed inset-0 flex justify-center",
|
|
145
|
+
isTop
|
|
146
|
+
? // Pinned near the top at every breakpoint — never bottom-aligned.
|
|
147
|
+
"items-start px-base pt-[12dvh] pb-base"
|
|
148
|
+
: "items-end p-base sm:items-center",
|
|
149
|
+
)}
|
|
150
|
+
>
|
|
118
151
|
<div
|
|
119
152
|
ref={setRefs}
|
|
120
153
|
role="dialog"
|
|
@@ -123,56 +156,70 @@ export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
|
123
156
|
aria-label={title ? undefined : ariaLabel ?? "Dialog"}
|
|
124
157
|
aria-describedby={description ? descId : undefined}
|
|
125
158
|
data-state={state}
|
|
159
|
+
data-placement={placement}
|
|
126
160
|
className={cn(
|
|
127
161
|
"relative flex max-h-[calc(100dvh-2rem)] w-full flex-col overflow-hidden rounded-lg border border-hairline-soft bg-canvas text-ink shadow-modal",
|
|
128
|
-
"
|
|
162
|
+
size === "lg"
|
|
163
|
+
? "sm:w-[var(--container-palette,40rem)]"
|
|
164
|
+
: "sm:w-[var(--container-modal,32rem)]",
|
|
129
165
|
"transition-[transform,translate,scale,opacity,visibility] duration-200 ease-out",
|
|
130
166
|
"data-[state=open]:visible data-[state=open]:translate-y-0 data-[state=open]:scale-100 data-[state=open]:opacity-100",
|
|
131
|
-
|
|
167
|
+
isTop
|
|
168
|
+
? "data-[state=closed]:-translate-y-2 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0"
|
|
169
|
+
: "data-[state=closed]:translate-y-2 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0",
|
|
170
|
+
"data-[state=closed]:invisible",
|
|
132
171
|
className,
|
|
133
172
|
)}
|
|
134
173
|
{...rest}
|
|
135
174
|
>
|
|
136
|
-
|
|
137
|
-
<div className="flex
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
|
|
160
|
-
|
|
175
|
+
{hasHeader ? (
|
|
176
|
+
<div className="flex shrink-0 items-start justify-between gap-md px-lg pt-lg">
|
|
177
|
+
<div className="flex min-w-0 flex-col gap-xs">
|
|
178
|
+
{icon ? (
|
|
179
|
+
<span
|
|
180
|
+
aria-hidden="true"
|
|
181
|
+
className={cn(
|
|
182
|
+
"mb-xs inline-flex size-12 items-center justify-center rounded-md",
|
|
183
|
+
tone === "danger"
|
|
184
|
+
? "bg-semantic-error-soft text-semantic-error"
|
|
185
|
+
: "bg-primary-soft text-primary",
|
|
186
|
+
)}
|
|
187
|
+
>
|
|
188
|
+
<Icon name={icon} size={26} />
|
|
189
|
+
</span>
|
|
190
|
+
) : null}
|
|
191
|
+
{title ? (
|
|
192
|
+
<h2 id={titleId} className="text-heading-md text-ink">
|
|
193
|
+
{title}
|
|
194
|
+
</h2>
|
|
195
|
+
) : null}
|
|
196
|
+
{description ? (
|
|
197
|
+
<p id={descId} className="text-body-md text-body">
|
|
198
|
+
{description}
|
|
199
|
+
</p>
|
|
200
|
+
) : null}
|
|
201
|
+
</div>
|
|
202
|
+
{!hideClose && (
|
|
203
|
+
<IconButton
|
|
204
|
+
icon="x"
|
|
205
|
+
variant="ghost"
|
|
206
|
+
size="sm"
|
|
207
|
+
aria-label={closeLabel}
|
|
208
|
+
onClick={() => onOpenChange(false)}
|
|
209
|
+
/>
|
|
210
|
+
)}
|
|
161
211
|
</div>
|
|
162
|
-
|
|
163
|
-
<IconButton
|
|
164
|
-
icon="x"
|
|
165
|
-
variant="ghost"
|
|
166
|
-
size="sm"
|
|
167
|
-
aria-label={closeLabel}
|
|
168
|
-
onClick={() => onOpenChange(false)}
|
|
169
|
-
/>
|
|
170
|
-
)}
|
|
171
|
-
</div>
|
|
212
|
+
) : null}
|
|
172
213
|
<div
|
|
173
214
|
className={cn(
|
|
174
|
-
"min-h-0 flex-1 overflow-y-auto overscroll-contain
|
|
175
|
-
|
|
215
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
216
|
+
hasHeader
|
|
217
|
+
? cn("px-lg", children ? "pt-base pb-lg" : "pb-base")
|
|
218
|
+
: bodyClassName
|
|
219
|
+
? // Chromeless panel: the caller owns the body padding (e.g. a palette
|
|
220
|
+
// that pins its own search row and scrolls only the results).
|
|
221
|
+
undefined
|
|
222
|
+
: "p-lg",
|
|
176
223
|
bodyClassName,
|
|
177
224
|
)}
|
|
178
225
|
>
|
|
@@ -12,18 +12,32 @@ const TEMPLATES = [
|
|
|
12
12
|
{ value: "content-pipeline", label: "Content pipeline" },
|
|
13
13
|
];
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const COMMANDS = [
|
|
16
|
+
"New board",
|
|
17
|
+
"New workflow",
|
|
18
|
+
"Invite teammates",
|
|
19
|
+
"Open settings",
|
|
20
|
+
"Search the archive",
|
|
21
|
+
"Toggle dark mode",
|
|
22
|
+
"Export as CSV",
|
|
23
|
+
"Manage notifications",
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
type Which = "plan" | "form" | "delete" | "palette" | null;
|
|
16
27
|
|
|
17
28
|
export default function ModalPreview() {
|
|
18
29
|
const [which, setWhich] = React.useState<Which>(null);
|
|
19
30
|
const [name, setName] = React.useState("Marketing campaign");
|
|
20
31
|
const [template, setTemplate] = React.useState<string>("marketing-calendar");
|
|
32
|
+
const [query, setQuery] = React.useState("");
|
|
21
33
|
const [last, setLast] = React.useState("Nothing confirmed yet.");
|
|
22
34
|
const close = (o: boolean) => {
|
|
23
35
|
if (!o) setWhich(null);
|
|
24
36
|
};
|
|
25
37
|
const templateLabelId = React.useId();
|
|
26
38
|
|
|
39
|
+
const results = COMMANDS.filter((c) => c.toLowerCase().includes(query.trim().toLowerCase()));
|
|
40
|
+
|
|
27
41
|
return (
|
|
28
42
|
<div className="w-full max-w-3xl mx-auto p-lg">
|
|
29
43
|
<div className="flex w-full flex-col items-center gap-base rounded-lg border border-hairline-soft bg-canvas p-xl shadow-card">
|
|
@@ -37,6 +51,9 @@ export default function ModalPreview() {
|
|
|
37
51
|
<Button variant="danger" aria-haspopup="dialog" onClick={() => setWhich("delete")}>
|
|
38
52
|
Delete board
|
|
39
53
|
</Button>
|
|
54
|
+
<Button variant="neutral" aria-haspopup="dialog" onClick={() => setWhich("palette")}>
|
|
55
|
+
Command palette
|
|
56
|
+
</Button>
|
|
40
57
|
</div>
|
|
41
58
|
<p className="text-body-sm text-muted" aria-live="polite">
|
|
42
59
|
{last}
|
|
@@ -126,6 +143,46 @@ export default function ModalPreview() {
|
|
|
126
143
|
</>
|
|
127
144
|
}
|
|
128
145
|
/>
|
|
146
|
+
|
|
147
|
+
{/* Top-anchored, wide, header-less panel: search pinned at the top, only the list scrolls. */}
|
|
148
|
+
<Modal
|
|
149
|
+
open={which === "palette"}
|
|
150
|
+
onOpenChange={close}
|
|
151
|
+
placement="top"
|
|
152
|
+
size="lg"
|
|
153
|
+
hideClose
|
|
154
|
+
aria-label="Command palette"
|
|
155
|
+
bodyClassName="p-0"
|
|
156
|
+
>
|
|
157
|
+
<div className="sticky top-0 z-10 flex shrink-0 flex-col gap-xs border-b border-hairline-soft bg-canvas px-lg py-base">
|
|
158
|
+
<FormField
|
|
159
|
+
label="Search commands"
|
|
160
|
+
placeholder="Type a command…"
|
|
161
|
+
value={query}
|
|
162
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
<ul className="flex flex-col p-xs">
|
|
166
|
+
{results.length === 0 ? (
|
|
167
|
+
<li className="px-md py-base text-body-sm text-muted">No matching commands.</li>
|
|
168
|
+
) : (
|
|
169
|
+
results.map((cmd) => (
|
|
170
|
+
<li key={cmd}>
|
|
171
|
+
<Button
|
|
172
|
+
variant="ghost"
|
|
173
|
+
className="w-full justify-start"
|
|
174
|
+
onClick={() => {
|
|
175
|
+
setLast(`Ran “${cmd}”.`);
|
|
176
|
+
setWhich(null);
|
|
177
|
+
}}
|
|
178
|
+
>
|
|
179
|
+
{cmd}
|
|
180
|
+
</Button>
|
|
181
|
+
</li>
|
|
182
|
+
))
|
|
183
|
+
)}
|
|
184
|
+
</ul>
|
|
185
|
+
</Modal>
|
|
129
186
|
</div>
|
|
130
187
|
);
|
|
131
188
|
}
|
package/src/tokens.css
CHANGED