qt-ui-kit 1.0.113 → 1.0.114

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.mjs CHANGED
@@ -17434,6 +17434,238 @@ function FilterBar({ buttons }) {
17434
17434
  ] });
17435
17435
  }
17436
17436
 
17437
+ // src/components/molecules/modal/modal.tsx
17438
+ import { useEffect as useEffect4, useRef as useRef2 } from "react";
17439
+ import { createPortal } from "react-dom";
17440
+ import clsx12 from "clsx";
17441
+ import { jsx as jsx46 } from "react/jsx-runtime";
17442
+ function Modal({
17443
+ isOpen,
17444
+ onClose,
17445
+ children,
17446
+ className,
17447
+ disableBackdropClick = false,
17448
+ disableEscapeKey = false
17449
+ }) {
17450
+ const modalRef = useRef2(null);
17451
+ const previousActiveElement = useRef2(null);
17452
+ useEffect4(() => {
17453
+ if (!isOpen || disableEscapeKey) return;
17454
+ const handleKeyDown = (e) => {
17455
+ if (e.key === "Escape") onClose();
17456
+ };
17457
+ document.addEventListener("keydown", handleKeyDown);
17458
+ return () => document.removeEventListener("keydown", handleKeyDown);
17459
+ }, [isOpen, onClose, disableEscapeKey]);
17460
+ useEffect4(() => {
17461
+ if (!isOpen) return;
17462
+ const originalOverflow = document.body.style.overflow;
17463
+ document.body.style.overflow = "hidden";
17464
+ previousActiveElement.current = document.activeElement;
17465
+ setTimeout(() => {
17466
+ const focusable = modalRef.current?.querySelectorAll(
17467
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
17468
+ );
17469
+ if (focusable && focusable.length > 0) {
17470
+ focusable[0].focus();
17471
+ }
17472
+ }, 0);
17473
+ return () => {
17474
+ document.body.style.overflow = originalOverflow;
17475
+ previousActiveElement.current?.focus();
17476
+ };
17477
+ }, [isOpen]);
17478
+ if (!isOpen) return null;
17479
+ const handleBackdropClick = () => {
17480
+ if (!disableBackdropClick) onClose();
17481
+ };
17482
+ return createPortal(
17483
+ /* @__PURE__ */ jsx46(
17484
+ "div",
17485
+ {
17486
+ className: "fixed inset-0 z-50 flex items-center justify-center bg-qtneutral-900/50 animate-fade-in",
17487
+ onClick: handleBackdropClick,
17488
+ "aria-modal": "true",
17489
+ role: "dialog",
17490
+ children: /* @__PURE__ */ jsx46(
17491
+ "div",
17492
+ {
17493
+ ref: modalRef,
17494
+ className: clsx12(
17495
+ "bg-white rounded-2xl p-6 max-w-[480px] w-full mx-4 modal-shadow animate-modal-scale",
17496
+ className
17497
+ ),
17498
+ onClick: (e) => e.stopPropagation(),
17499
+ role: "document",
17500
+ children
17501
+ }
17502
+ )
17503
+ }
17504
+ ),
17505
+ document.body
17506
+ );
17507
+ }
17508
+
17509
+ // src/components/molecules/modal/confirmation_modal.tsx
17510
+ import clsx13 from "clsx";
17511
+ import { jsx as jsx47, jsxs as jsxs33 } from "react/jsx-runtime";
17512
+ var variantStyles = {
17513
+ danger: {
17514
+ confirm: "bg-qtred-500 text-white hover:bg-qtred-400",
17515
+ cancel: "bg-white text-qtpurple-500 border-2 border-qtpurple-500 hover:bg-qtpurple-200"
17516
+ },
17517
+ primary: {
17518
+ confirm: "bg-qtpurple-500 text-white hover:bg-qtpurple-600",
17519
+ cancel: "bg-white text-qtpurple-500 border-2 border-qtpurple-500 hover:bg-qtpurple-200"
17520
+ },
17521
+ warning: {
17522
+ confirm: "bg-qtorange-400 text-qtneutral-900 hover:bg-qtorange-300",
17523
+ cancel: "bg-white text-qtpurple-500 border-2 border-qtpurple-500 hover:bg-qtpurple-200"
17524
+ }
17525
+ };
17526
+ function ConfirmationModal({
17527
+ isOpen,
17528
+ onClose,
17529
+ onConfirm,
17530
+ title,
17531
+ message: message2,
17532
+ confirmLabel = "Confirm",
17533
+ cancelLabel = "Cancel",
17534
+ variant = "primary",
17535
+ children
17536
+ }) {
17537
+ const buttonBase = "px-4 py-2.5 rounded-lg label-1-bold transition-colors";
17538
+ const styles = variantStyles[variant];
17539
+ return /* @__PURE__ */ jsx47(Modal, { isOpen, onClose, children: /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-6", children: [
17540
+ /* @__PURE__ */ jsx47("h2", { className: "label-1-bold text-qtneutral-900", children: title }),
17541
+ message2 && /* @__PURE__ */ jsx47("div", { className: "body-small text-qtneutral-800 whitespace-pre-line", children: typeof message2 === "string" ? /* @__PURE__ */ jsx47("p", { children: message2 }) : message2 }),
17542
+ children,
17543
+ /* @__PURE__ */ jsxs33("div", { className: "flex gap-4 justify-end", children: [
17544
+ /* @__PURE__ */ jsx47(
17545
+ "button",
17546
+ {
17547
+ onClick: onConfirm,
17548
+ className: clsx13(buttonBase, styles.confirm),
17549
+ children: confirmLabel
17550
+ }
17551
+ ),
17552
+ /* @__PURE__ */ jsx47(
17553
+ "button",
17554
+ {
17555
+ onClick: onClose,
17556
+ className: clsx13(buttonBase, styles.cancel, "px-8"),
17557
+ children: cancelLabel
17558
+ }
17559
+ )
17560
+ ] })
17561
+ ] }) });
17562
+ }
17563
+
17564
+ // src/components/organisms/account/info/account_info_field.tsx
17565
+ import { jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
17566
+ function AccountInfoField({
17567
+ label,
17568
+ value,
17569
+ className = ""
17570
+ }) {
17571
+ return /* @__PURE__ */ jsxs34("div", { className: `flex-1 flex flex-col flex-wrap gap-2 ${className}`, children: [
17572
+ /* @__PURE__ */ jsx48("label", { className: "body-bold text-qtneutral-900", children: label }),
17573
+ /* @__PURE__ */ jsx48("p", { className: "body text-qtneutral-900", children: value || "-" })
17574
+ ] });
17575
+ }
17576
+
17577
+ // src/components/organisms/account/info/account_info_section.tsx
17578
+ import { jsx as jsx49, jsxs as jsxs35 } from "react/jsx-runtime";
17579
+ function AccountInfoSection({
17580
+ title,
17581
+ children
17582
+ }) {
17583
+ return /* @__PURE__ */ jsxs35("div", { className: "flex flex-col flex-wrap gap-4 pt-6 pb-6", children: [
17584
+ title && /* @__PURE__ */ jsx49("div", { className: "body-bold text-qtneutral-900", children: title }),
17585
+ /* @__PURE__ */ jsx49("div", { className: "user-data-row", children })
17586
+ ] });
17587
+ }
17588
+
17589
+ // src/components/organisms/account/integrations/account_integration_card.tsx
17590
+ import React2 from "react";
17591
+ import clsx14 from "clsx";
17592
+ import { jsx as jsx50, jsxs as jsxs36 } from "react/jsx-runtime";
17593
+ var AccountIntegrationCard = React2.memo(function AccountIntegrationCard2({
17594
+ integrationName,
17595
+ children,
17596
+ onConnect,
17597
+ disabled,
17598
+ ready,
17599
+ icon,
17600
+ limit
17601
+ }) {
17602
+ const count = Array.isArray(children) ? children.length : children ? 1 : 0;
17603
+ const isLimitReached = count >= limit;
17604
+ return /* @__PURE__ */ jsxs36("div", { className: "card-your-apps flex flex-col items-center gap-4 rounded-lg border-2 border-qtneutral-400 bg-white p-4", children: [
17605
+ /* @__PURE__ */ jsxs36("div", { className: "flex w-full items-center justify-between", children: [
17606
+ /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-3", children: [
17607
+ /* @__PURE__ */ jsx50(
17608
+ "div",
17609
+ {
17610
+ className: clsx14(
17611
+ "w-[44px] h-[44px] flex items-center justify-center transition-opacity border-none bg-transparent p-0",
17612
+ !ready && "opacity-50 cursor-not-allowed",
17613
+ disabled && "grayscale border-2 border-green-700 bg-green-100"
17614
+ ),
17615
+ "aria-label": `Integrate with ${integrationName}`,
17616
+ children: icon
17617
+ }
17618
+ ),
17619
+ /* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-1.5", children: [
17620
+ /* @__PURE__ */ jsx50("span", { className: "text-sm font-bold", children: integrationName }),
17621
+ /* @__PURE__ */ jsx50("span", { className: "body-small text-qtneutral-800", children: count > 0 ? `${count} of ${limit} connected` : "No accounts connected" })
17622
+ ] })
17623
+ ] }),
17624
+ !isLimitReached && ready && /* @__PURE__ */ jsx50(
17625
+ "button",
17626
+ {
17627
+ onClick: onConnect,
17628
+ disabled: disabled || !ready,
17629
+ className: clsx14(
17630
+ "label-1-bold text-qtpurple-600 bg-transparent border-none p-0 cursor-pointer hover:text-qtpurple-500",
17631
+ (disabled || !ready) && "opacity-50 cursor-not-allowed pointer-events-none"
17632
+ ),
17633
+ children: count > 0 ? `+ Connect Another` : `+ Connect`
17634
+ }
17635
+ )
17636
+ ] }),
17637
+ count > 0 && /* @__PURE__ */ jsx50("div", { className: "flex w-full flex-col gap-2.5", children })
17638
+ ] });
17639
+ });
17640
+ var account_integration_card_default = AccountIntegrationCard;
17641
+
17642
+ // src/components/organisms/account/integrations/account_integration_card_item.tsx
17643
+ import React3 from "react";
17644
+ import { jsx as jsx51, jsxs as jsxs37 } from "react/jsx-runtime";
17645
+ var AccountIntegrationCardItem = React3.memo(
17646
+ function AccountIntegrationCardItem2({
17647
+ name,
17648
+ onDisconnect
17649
+ }) {
17650
+ return /* @__PURE__ */ jsxs37("div", { className: "flex flex-row flex-nowrap justify-between items-center bg-qtneutral-100 p-4 border border-qtpurple-500 rounded-lg", children: [
17651
+ /* @__PURE__ */ jsx51("div", { className: "label-1-bold text-qtneutral-900", children: name }),
17652
+ /* @__PURE__ */ jsx51(
17653
+ "button",
17654
+ {
17655
+ type: "button",
17656
+ className: "label-2 text-qtred-500 underline bg-transparent border-none p-0 cursor-pointer hover:text-qtred-400",
17657
+ onClick: (e) => {
17658
+ e.stopPropagation();
17659
+ onDisconnect();
17660
+ },
17661
+ children: "Disconnect"
17662
+ }
17663
+ )
17664
+ ] });
17665
+ }
17666
+ );
17667
+ var account_integration_card_item_default = AccountIntegrationCardItem;
17668
+
17437
17669
  // src/types/events.ts
17438
17670
  var EventState = /* @__PURE__ */ ((EventState2) => {
17439
17671
  EventState2["NEW"] = "new";
@@ -17543,16 +17775,22 @@ This is a *markdown* **example**.
17543
17775
  }
17544
17776
  ];
17545
17777
  export {
17778
+ AccountInfoField,
17779
+ AccountInfoSection,
17780
+ account_integration_card_default as AccountIntegrationCard,
17781
+ account_integration_card_item_default as AccountIntegrationCardItem,
17546
17782
  BaseIconName,
17547
17783
  BrandIcon,
17548
17784
  ChatBody,
17549
17785
  ColorVariants,
17786
+ ConfirmationModal,
17550
17787
  EmailBody,
17551
17788
  EventCard,
17552
17789
  EventState,
17553
17790
  EventType,
17554
17791
  FilterBar,
17555
17792
  IntegrationService,
17793
+ Modal,
17556
17794
  NavBar,
17557
17795
  PreviewCard,
17558
17796
  SearchBar,