@fuf-stack/pixels 0.0.6 → 0.1.0

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.
Files changed (120) hide show
  1. package/dist/{components/Button → Button}/Button.cjs +3 -3
  2. package/dist/Button/Button.cjs.map +1 -0
  3. package/dist/Button/Button.js +8 -0
  4. package/dist/{components/Button → Button}/index.cjs +5 -5
  5. package/dist/Button/index.cjs.map +1 -0
  6. package/dist/Button/index.js +11 -0
  7. package/dist/Button/index.js.map +1 -0
  8. package/dist/{components/Button → Button}/subcomponents/LoadingSpinner.cjs +1 -1
  9. package/dist/Button/subcomponents/LoadingSpinner.cjs.map +1 -0
  10. package/dist/{components/Button → Button}/subcomponents/LoadingSpinner.js +1 -1
  11. package/dist/{components/Card → Card}/Card.cjs +1 -1
  12. package/dist/Card/Card.cjs.map +1 -0
  13. package/dist/{components/Card → Card}/Card.d.cts +3 -3
  14. package/dist/{components/Card → Card}/Card.d.ts +3 -3
  15. package/dist/{components/Card → Card}/Card.js +1 -1
  16. package/dist/{components/Card → Card}/index.cjs +3 -3
  17. package/dist/Card/index.cjs.map +1 -0
  18. package/dist/{components/Card → Card}/index.d.cts +1 -1
  19. package/dist/{components/Card → Card}/index.d.ts +1 -1
  20. package/dist/Card/index.js +10 -0
  21. package/dist/Card/index.js.map +1 -0
  22. package/dist/Label/Label.cjs +58 -0
  23. package/dist/Label/Label.cjs.map +1 -0
  24. package/dist/Label/Label.d.cts +24 -0
  25. package/dist/Label/Label.d.ts +24 -0
  26. package/dist/Label/Label.js +7 -0
  27. package/dist/Label/Label.js.map +1 -0
  28. package/dist/Label/index.cjs +63 -0
  29. package/dist/Label/index.cjs.map +1 -0
  30. package/dist/Label/index.d.cts +8 -0
  31. package/dist/Label/index.d.ts +8 -0
  32. package/dist/Label/index.js +10 -0
  33. package/dist/Label/index.js.map +1 -0
  34. package/dist/Menu/Menu.cjs +97 -0
  35. package/dist/Menu/Menu.cjs.map +1 -0
  36. package/dist/Menu/Menu.d.cts +55 -0
  37. package/dist/Menu/Menu.d.ts +55 -0
  38. package/dist/Menu/Menu.js +7 -0
  39. package/dist/Menu/Menu.js.map +1 -0
  40. package/dist/Menu/index.cjs +102 -0
  41. package/dist/Menu/index.cjs.map +1 -0
  42. package/dist/Menu/index.d.cts +7 -0
  43. package/dist/Menu/index.d.ts +7 -0
  44. package/dist/Menu/index.js +10 -0
  45. package/dist/Menu/index.js.map +1 -0
  46. package/dist/Modal/Modal.cjs +86 -0
  47. package/dist/Modal/Modal.cjs.map +1 -0
  48. package/dist/Modal/Modal.d.cts +29 -0
  49. package/dist/Modal/Modal.d.ts +29 -0
  50. package/dist/Modal/Modal.js +9 -0
  51. package/dist/Modal/Modal.js.map +1 -0
  52. package/dist/Modal/index.cjs +85 -0
  53. package/dist/Modal/index.cjs.map +1 -0
  54. package/dist/Modal/index.d.cts +7 -0
  55. package/dist/Modal/index.d.ts +7 -0
  56. package/dist/Modal/index.js +10 -0
  57. package/dist/Modal/index.js.map +1 -0
  58. package/dist/Popover/Popover.cjs +72 -0
  59. package/dist/Popover/Popover.cjs.map +1 -0
  60. package/dist/Popover/Popover.d.cts +31 -0
  61. package/dist/Popover/Popover.d.ts +31 -0
  62. package/dist/Popover/Popover.js +7 -0
  63. package/dist/Popover/Popover.js.map +1 -0
  64. package/dist/Popover/index.cjs +77 -0
  65. package/dist/Popover/index.cjs.map +1 -0
  66. package/dist/Popover/index.d.cts +8 -0
  67. package/dist/Popover/index.d.ts +8 -0
  68. package/dist/Popover/index.js +10 -0
  69. package/dist/Popover/index.js.map +1 -0
  70. package/dist/Tooltip/Tooltip.cjs +68 -0
  71. package/dist/Tooltip/Tooltip.cjs.map +1 -0
  72. package/dist/Tooltip/Tooltip.d.cts +27 -0
  73. package/dist/Tooltip/Tooltip.d.ts +27 -0
  74. package/dist/Tooltip/Tooltip.js +9 -0
  75. package/dist/Tooltip/Tooltip.js.map +1 -0
  76. package/dist/Tooltip/index.cjs +67 -0
  77. package/dist/Tooltip/index.cjs.map +1 -0
  78. package/dist/Tooltip/index.d.cts +7 -0
  79. package/dist/Tooltip/index.d.ts +7 -0
  80. package/dist/Tooltip/index.js +10 -0
  81. package/dist/Tooltip/index.js.map +1 -0
  82. package/dist/chunk-6ZUWYBMG.js +73 -0
  83. package/dist/chunk-6ZUWYBMG.js.map +1 -0
  84. package/dist/chunk-CEUL4NWH.js +28 -0
  85. package/dist/chunk-CEUL4NWH.js.map +1 -0
  86. package/dist/chunk-EYUTNORZ.js +58 -0
  87. package/dist/chunk-EYUTNORZ.js.map +1 -0
  88. package/dist/chunk-ONXXZTZY.js +34 -0
  89. package/dist/chunk-ONXXZTZY.js.map +1 -0
  90. package/dist/chunk-SGAWYTO7.js +42 -0
  91. package/dist/chunk-SGAWYTO7.js.map +1 -0
  92. package/dist/{chunk-XWTXH2TR.js → chunk-XPTSDDXG.js} +2 -2
  93. package/dist/chunk-XPTSDDXG.js.map +1 -0
  94. package/dist/{chunk-YOPQSZ46.js → chunk-ZFEVTQWW.js} +2 -2
  95. package/dist/chunk-ZFEVTQWW.js.map +1 -0
  96. package/dist/{chunk-WQN756O7.js → chunk-ZXTDGCUF.js} +3 -3
  97. package/dist/chunk-ZXTDGCUF.js.map +1 -0
  98. package/package.json +3 -5
  99. package/dist/chunk-WQN756O7.js.map +0 -1
  100. package/dist/chunk-XWTXH2TR.js.map +0 -1
  101. package/dist/chunk-YOPQSZ46.js.map +0 -1
  102. package/dist/components/Button/Button.cjs.map +0 -1
  103. package/dist/components/Button/Button.js +0 -8
  104. package/dist/components/Button/index.cjs.map +0 -1
  105. package/dist/components/Button/index.js +0 -11
  106. package/dist/components/Button/index.js.map +0 -1
  107. package/dist/components/Button/subcomponents/LoadingSpinner.cjs.map +0 -1
  108. package/dist/components/Card/Card.cjs.map +0 -1
  109. package/dist/components/Card/index.cjs.map +0 -1
  110. package/dist/components/Card/index.js +0 -10
  111. package/dist/components/Card/index.js.map +0 -1
  112. /package/dist/{components/Button → Button}/Button.d.cts +0 -0
  113. /package/dist/{components/Button → Button}/Button.d.ts +0 -0
  114. /package/dist/{components/Button → Button}/Button.js.map +0 -0
  115. /package/dist/{components/Button → Button}/index.d.cts +0 -0
  116. /package/dist/{components/Button → Button}/index.d.ts +0 -0
  117. /package/dist/{components/Button → Button}/subcomponents/LoadingSpinner.d.cts +0 -0
  118. /package/dist/{components/Button → Button}/subcomponents/LoadingSpinner.d.ts +0 -0
  119. /package/dist/{components/Button → Button}/subcomponents/LoadingSpinner.js.map +0 -0
  120. /package/dist/{components/Card → Card}/Card.js.map +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Menu/Menu.tsx"],"sourcesContent":["import type { DropdownSectionProps } from '@nextui-org/dropdown';\nimport type { Key, MouseEventHandler, ReactNode } from 'react';\n\nimport { FaEllipsisVertical } from 'react-icons/fa6';\n\nimport {\n Dropdown as NextDropdown,\n DropdownItem as NextDropdownItem,\n DropdownMenu as NextDropdownMenu,\n DropdownSection as NextDropdownSection,\n DropdownTrigger as NextDropdownTrigger,\n} from '@nextui-org/dropdown';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nconst debug = createDebug('component:Menu');\n\n/**\n * Menu item type\n */\nexport interface MenuItem {\n /** unique identifier */\n key: string;\n /** CSS class name */\n className?: string;\n /** additional description shown under the label */\n description?: string;\n /** disables the menu item */\n disabled?: boolean;\n /** menu item icon */\n icon?: ReactNode;\n /** menu item name */\n label: ReactNode;\n /** click event handler */\n onClick?: MouseEventHandler<HTMLLIElement>;\n /** e2e test identifier */\n testId?: string;\n}\n\n/**\n * Menu section type\n */\nexport interface MenuSection {\n /** unique identifier */\n key: string;\n /** section label */\n label: ReactNode;\n /** section items (array of MenuItem) */\n items: MenuItem[];\n}\n\nexport interface MenuProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** menu item structure */\n items: (MenuSection | MenuItem)[];\n /** disable menu trigger */\n isDisabled?: boolean;\n /** called if item is selected */\n onAction?: (key: Key) => void;\n}\n\n/** returns String[] of disabled items/keys */\nconst getDisabledKeys = (items: (MenuSection | MenuItem)[]) => {\n return (\n items\n // @ts-expect-error typing issue with MenuSection | MenuItem\n .map((item) => (typeof item?.items === 'undefined' ? item : item.items))\n .flat<MenuItem[]>()\n .filter((item) => {\n return Object.hasOwn(item, 'disabled') && item.disabled === true;\n })\n .map((item) => item.key)\n );\n};\n\nconst renderMenuItem = (item: MenuItem) => (\n <NextDropdownItem\n className={item.className}\n data-testid={item.testId || item.key}\n description={item.description}\n key={item.key}\n onClick={item.onClick}\n startContent={item.icon}\n >\n {item.label}\n </NextDropdownItem>\n);\n\n/**\n * Dropdown menu component based on [NextUI Dropdown](https://nextui.org/docs/components/dropdown)\n */\nconst Menu = ({\n children = null,\n className = undefined,\n onAction = undefined,\n testId = undefined,\n isDisabled = false,\n items,\n}: MenuProps) => {\n debug('Menu', { items });\n\n return (\n <NextDropdown isDisabled={isDisabled}>\n <NextDropdownTrigger className={cn(className)} data-testid={testId}>\n {/* eslint-disable-next-line react/button-has-type */}\n <button>{children || <FaEllipsisVertical className=\"px-2\" />}</button>\n </NextDropdownTrigger>\n <NextDropdownMenu\n // aria-label=\"Dynamic Actions\"\n items={items}\n disabledKeys={getDisabledKeys(items)}\n onAction={onAction}\n >\n {(item) => {\n if ('items' in item) {\n return (\n <NextDropdownSection\n items={item.items as MenuSection['items']}\n title={item.label as DropdownSectionProps['title']}\n key={item.key}\n >\n {/* @ts-expect-error ts problem here with render fn */}\n {(sectionItem) => {\n return renderMenuItem(sectionItem);\n }}\n </NextDropdownSection>\n );\n }\n return renderMenuItem(item);\n }}\n </NextDropdownMenu>\n </NextDropdown>\n );\n};\n\nexport default Menu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAmC;AAEnC,sBAMO;AACP,wBAAe;AACf,mBAAwB;AAoEtB;AAlEF,IAAM,YAAQ,aAAAA,SAAY,gBAAgB;AAoD1C,IAAM,kBAAkB,CAAC,UAAsC;AAC7D,SACE,MAEG,IAAI,CAAC,SAAU,OAAO,MAAM,UAAU,cAAc,OAAO,KAAK,KAAM,EACtE,KAAiB,EACjB,OAAO,CAAC,SAAS;AAChB,WAAO,OAAO,OAAO,MAAM,UAAU,KAAK,KAAK,aAAa;AAAA,EAC9D,CAAC,EACA,IAAI,CAAC,SAAS,KAAK,GAAG;AAE7B;AAEA,IAAM,iBAAiB,CAAC,SACtB;AAAA,EAAC,gBAAAC;AAAA,EAAA;AAAA,IACC,WAAW,KAAK;AAAA,IAChB,eAAa,KAAK,UAAU,KAAK;AAAA,IACjC,aAAa,KAAK;AAAA,IAElB,SAAS,KAAK;AAAA,IACd,cAAc,KAAK;AAAA,IAElB,eAAK;AAAA;AAAA,EAJD,KAAK;AAKZ;AAMF,IAAM,OAAO,CAAC;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,aAAa;AAAA,EACb;AACF,MAAiB;AACf,QAAM,QAAQ,EAAE,MAAM,CAAC;AAEvB,SACE,6CAAC,gBAAAC,UAAA,EAAa,YACZ;AAAA,gDAAC,gBAAAC,iBAAA,EAAoB,eAAW,kBAAAC,SAAG,SAAS,GAAG,eAAa,QAE1D,sDAAC,YAAQ,sBAAY,4CAAC,iCAAmB,WAAU,QAAO,GAAG,GAC/D;AAAA,IACA;AAAA,MAAC,gBAAAC;AAAA,MAAA;AAAA,QAEC;AAAA,QACA,cAAc,gBAAgB,KAAK;AAAA,QACnC;AAAA,QAEC,WAAC,SAAS;AACT,cAAI,WAAW,MAAM;AACnB,mBACE;AAAA,cAAC,gBAAAC;AAAA,cAAA;AAAA,gBACC,OAAO,KAAK;AAAA,gBACZ,OAAO,KAAK;AAAA,gBAIX,WAAC,gBAAgB;AAChB,yBAAO,eAAe,WAAW;AAAA,gBACnC;AAAA;AAAA,cALK,KAAK;AAAA,YAMZ;AAAA,UAEJ;AACA,iBAAO,eAAe,IAAI;AAAA,QAC5B;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAO,eAAQ;","names":["createDebug","NextDropdownItem","NextDropdown","NextDropdownTrigger","cn","NextDropdownMenu","NextDropdownSection"]}
@@ -0,0 +1,55 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, MouseEventHandler, Key } from 'react';
3
+
4
+ /**
5
+ * Menu item type
6
+ */
7
+ interface MenuItem {
8
+ /** unique identifier */
9
+ key: string;
10
+ /** CSS class name */
11
+ className?: string;
12
+ /** additional description shown under the label */
13
+ description?: string;
14
+ /** disables the menu item */
15
+ disabled?: boolean;
16
+ /** menu item icon */
17
+ icon?: ReactNode;
18
+ /** menu item name */
19
+ label: ReactNode;
20
+ /** click event handler */
21
+ onClick?: MouseEventHandler<HTMLLIElement>;
22
+ /** e2e test identifier */
23
+ testId?: string;
24
+ }
25
+ /**
26
+ * Menu section type
27
+ */
28
+ interface MenuSection {
29
+ /** unique identifier */
30
+ key: string;
31
+ /** section label */
32
+ label: ReactNode;
33
+ /** section items (array of MenuItem) */
34
+ items: MenuItem[];
35
+ }
36
+ interface MenuProps {
37
+ /** child components */
38
+ children?: ReactNode;
39
+ /** CSS class name */
40
+ className?: string | string[];
41
+ /** HTML data-testid attribute used in e2e tests */
42
+ testId?: string;
43
+ /** menu item structure */
44
+ items: (MenuSection | MenuItem)[];
45
+ /** disable menu trigger */
46
+ isDisabled?: boolean;
47
+ /** called if item is selected */
48
+ onAction?: (key: Key) => void;
49
+ }
50
+ /**
51
+ * Dropdown menu component based on [NextUI Dropdown](https://nextui.org/docs/components/dropdown)
52
+ */
53
+ declare const Menu: ({ children, className, onAction, testId, isDisabled, items, }: MenuProps) => react_jsx_runtime.JSX.Element;
54
+
55
+ export { type MenuItem, type MenuProps, type MenuSection, Menu as default };
@@ -0,0 +1,55 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, MouseEventHandler, Key } from 'react';
3
+
4
+ /**
5
+ * Menu item type
6
+ */
7
+ interface MenuItem {
8
+ /** unique identifier */
9
+ key: string;
10
+ /** CSS class name */
11
+ className?: string;
12
+ /** additional description shown under the label */
13
+ description?: string;
14
+ /** disables the menu item */
15
+ disabled?: boolean;
16
+ /** menu item icon */
17
+ icon?: ReactNode;
18
+ /** menu item name */
19
+ label: ReactNode;
20
+ /** click event handler */
21
+ onClick?: MouseEventHandler<HTMLLIElement>;
22
+ /** e2e test identifier */
23
+ testId?: string;
24
+ }
25
+ /**
26
+ * Menu section type
27
+ */
28
+ interface MenuSection {
29
+ /** unique identifier */
30
+ key: string;
31
+ /** section label */
32
+ label: ReactNode;
33
+ /** section items (array of MenuItem) */
34
+ items: MenuItem[];
35
+ }
36
+ interface MenuProps {
37
+ /** child components */
38
+ children?: ReactNode;
39
+ /** CSS class name */
40
+ className?: string | string[];
41
+ /** HTML data-testid attribute used in e2e tests */
42
+ testId?: string;
43
+ /** menu item structure */
44
+ items: (MenuSection | MenuItem)[];
45
+ /** disable menu trigger */
46
+ isDisabled?: boolean;
47
+ /** called if item is selected */
48
+ onAction?: (key: Key) => void;
49
+ }
50
+ /**
51
+ * Dropdown menu component based on [NextUI Dropdown](https://nextui.org/docs/components/dropdown)
52
+ */
53
+ declare const Menu: ({ children, className, onAction, testId, isDisabled, items, }: MenuProps) => react_jsx_runtime.JSX.Element;
54
+
55
+ export { type MenuItem, type MenuProps, type MenuSection, Menu as default };
@@ -0,0 +1,7 @@
1
+ import {
2
+ Menu_default
3
+ } from "../chunk-6ZUWYBMG.js";
4
+ export {
5
+ Menu_default as default
6
+ };
7
+ //# sourceMappingURL=Menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/Menu/index.ts
31
+ var Menu_exports = {};
32
+ __export(Menu_exports, {
33
+ default: () => Menu_default2
34
+ });
35
+ module.exports = __toCommonJS(Menu_exports);
36
+
37
+ // src/Menu/Menu.tsx
38
+ var import_fa6 = require("react-icons/fa6");
39
+ var import_dropdown = require("@nextui-org/dropdown");
40
+ var import_classnames = __toESM(require("classnames"), 1);
41
+ var import_debug = __toESM(require("debug"), 1);
42
+ var import_jsx_runtime = require("react/jsx-runtime");
43
+ var debug = (0, import_debug.default)("component:Menu");
44
+ var getDisabledKeys = (items) => {
45
+ return items.map((item) => typeof item?.items === "undefined" ? item : item.items).flat().filter((item) => {
46
+ return Object.hasOwn(item, "disabled") && item.disabled === true;
47
+ }).map((item) => item.key);
48
+ };
49
+ var renderMenuItem = (item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
+ import_dropdown.DropdownItem,
51
+ {
52
+ className: item.className,
53
+ "data-testid": item.testId || item.key,
54
+ description: item.description,
55
+ onClick: item.onClick,
56
+ startContent: item.icon,
57
+ children: item.label
58
+ },
59
+ item.key
60
+ );
61
+ var Menu = ({
62
+ children = null,
63
+ className = void 0,
64
+ onAction = void 0,
65
+ testId = void 0,
66
+ isDisabled = false,
67
+ items
68
+ }) => {
69
+ debug("Menu", { items });
70
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown.Dropdown, { isDisabled, children: [
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown.DropdownTrigger, { className: (0, import_classnames.default)(className), "data-testid": testId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { children: children || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_fa6.FaEllipsisVertical, { className: "px-2" }) }) }),
72
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ import_dropdown.DropdownMenu,
74
+ {
75
+ items,
76
+ disabledKeys: getDisabledKeys(items),
77
+ onAction,
78
+ children: (item) => {
79
+ if ("items" in item) {
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
81
+ import_dropdown.DropdownSection,
82
+ {
83
+ items: item.items,
84
+ title: item.label,
85
+ children: (sectionItem) => {
86
+ return renderMenuItem(sectionItem);
87
+ }
88
+ },
89
+ item.key
90
+ );
91
+ }
92
+ return renderMenuItem(item);
93
+ }
94
+ }
95
+ )
96
+ ] });
97
+ };
98
+ var Menu_default = Menu;
99
+
100
+ // src/Menu/index.ts
101
+ var Menu_default2 = Menu_default;
102
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Menu/index.ts","../../src/Menu/Menu.tsx"],"sourcesContent":["import Menu from './Menu';\n\nexport default Menu;\n","import type { DropdownSectionProps } from '@nextui-org/dropdown';\nimport type { Key, MouseEventHandler, ReactNode } from 'react';\n\nimport { FaEllipsisVertical } from 'react-icons/fa6';\n\nimport {\n Dropdown as NextDropdown,\n DropdownItem as NextDropdownItem,\n DropdownMenu as NextDropdownMenu,\n DropdownSection as NextDropdownSection,\n DropdownTrigger as NextDropdownTrigger,\n} from '@nextui-org/dropdown';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nconst debug = createDebug('component:Menu');\n\n/**\n * Menu item type\n */\nexport interface MenuItem {\n /** unique identifier */\n key: string;\n /** CSS class name */\n className?: string;\n /** additional description shown under the label */\n description?: string;\n /** disables the menu item */\n disabled?: boolean;\n /** menu item icon */\n icon?: ReactNode;\n /** menu item name */\n label: ReactNode;\n /** click event handler */\n onClick?: MouseEventHandler<HTMLLIElement>;\n /** e2e test identifier */\n testId?: string;\n}\n\n/**\n * Menu section type\n */\nexport interface MenuSection {\n /** unique identifier */\n key: string;\n /** section label */\n label: ReactNode;\n /** section items (array of MenuItem) */\n items: MenuItem[];\n}\n\nexport interface MenuProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** menu item structure */\n items: (MenuSection | MenuItem)[];\n /** disable menu trigger */\n isDisabled?: boolean;\n /** called if item is selected */\n onAction?: (key: Key) => void;\n}\n\n/** returns String[] of disabled items/keys */\nconst getDisabledKeys = (items: (MenuSection | MenuItem)[]) => {\n return (\n items\n // @ts-expect-error typing issue with MenuSection | MenuItem\n .map((item) => (typeof item?.items === 'undefined' ? item : item.items))\n .flat<MenuItem[]>()\n .filter((item) => {\n return Object.hasOwn(item, 'disabled') && item.disabled === true;\n })\n .map((item) => item.key)\n );\n};\n\nconst renderMenuItem = (item: MenuItem) => (\n <NextDropdownItem\n className={item.className}\n data-testid={item.testId || item.key}\n description={item.description}\n key={item.key}\n onClick={item.onClick}\n startContent={item.icon}\n >\n {item.label}\n </NextDropdownItem>\n);\n\n/**\n * Dropdown menu component based on [NextUI Dropdown](https://nextui.org/docs/components/dropdown)\n */\nconst Menu = ({\n children = null,\n className = undefined,\n onAction = undefined,\n testId = undefined,\n isDisabled = false,\n items,\n}: MenuProps) => {\n debug('Menu', { items });\n\n return (\n <NextDropdown isDisabled={isDisabled}>\n <NextDropdownTrigger className={cn(className)} data-testid={testId}>\n {/* eslint-disable-next-line react/button-has-type */}\n <button>{children || <FaEllipsisVertical className=\"px-2\" />}</button>\n </NextDropdownTrigger>\n <NextDropdownMenu\n // aria-label=\"Dynamic Actions\"\n items={items}\n disabledKeys={getDisabledKeys(items)}\n onAction={onAction}\n >\n {(item) => {\n if ('items' in item) {\n return (\n <NextDropdownSection\n items={item.items as MenuSection['items']}\n title={item.label as DropdownSectionProps['title']}\n key={item.key}\n >\n {/* @ts-expect-error ts problem here with render fn */}\n {(sectionItem) => {\n return renderMenuItem(sectionItem);\n }}\n </NextDropdownSection>\n );\n }\n return renderMenuItem(item);\n }}\n </NextDropdownMenu>\n </NextDropdown>\n );\n};\n\nexport default Menu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACGA,iBAAmC;AAEnC,sBAMO;AACP,wBAAe;AACf,mBAAwB;AAoEtB;AAlEF,IAAM,YAAQ,aAAAC,SAAY,gBAAgB;AAoD1C,IAAM,kBAAkB,CAAC,UAAsC;AAC7D,SACE,MAEG,IAAI,CAAC,SAAU,OAAO,MAAM,UAAU,cAAc,OAAO,KAAK,KAAM,EACtE,KAAiB,EACjB,OAAO,CAAC,SAAS;AAChB,WAAO,OAAO,OAAO,MAAM,UAAU,KAAK,KAAK,aAAa;AAAA,EAC9D,CAAC,EACA,IAAI,CAAC,SAAS,KAAK,GAAG;AAE7B;AAEA,IAAM,iBAAiB,CAAC,SACtB;AAAA,EAAC,gBAAAC;AAAA,EAAA;AAAA,IACC,WAAW,KAAK;AAAA,IAChB,eAAa,KAAK,UAAU,KAAK;AAAA,IACjC,aAAa,KAAK;AAAA,IAElB,SAAS,KAAK;AAAA,IACd,cAAc,KAAK;AAAA,IAElB,eAAK;AAAA;AAAA,EAJD,KAAK;AAKZ;AAMF,IAAM,OAAO,CAAC;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,aAAa;AAAA,EACb;AACF,MAAiB;AACf,QAAM,QAAQ,EAAE,MAAM,CAAC;AAEvB,SACE,6CAAC,gBAAAC,UAAA,EAAa,YACZ;AAAA,gDAAC,gBAAAC,iBAAA,EAAoB,eAAW,kBAAAC,SAAG,SAAS,GAAG,eAAa,QAE1D,sDAAC,YAAQ,sBAAY,4CAAC,iCAAmB,WAAU,QAAO,GAAG,GAC/D;AAAA,IACA;AAAA,MAAC,gBAAAC;AAAA,MAAA;AAAA,QAEC;AAAA,QACA,cAAc,gBAAgB,KAAK;AAAA,QACnC;AAAA,QAEC,WAAC,SAAS;AACT,cAAI,WAAW,MAAM;AACnB,mBACE;AAAA,cAAC,gBAAAC;AAAA,cAAA;AAAA,gBACC,OAAO,KAAK;AAAA,gBACZ,OAAO,KAAK;AAAA,gBAIX,WAAC,gBAAgB;AAChB,yBAAO,eAAe,WAAW;AAAA,gBACnC;AAAA;AAAA,cALK,KAAK;AAAA,YAMZ;AAAA,UAEJ;AACA,iBAAO,eAAe,IAAI;AAAA,QAC5B;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAO,eAAQ;;;AD1If,IAAOC,gBAAQ;","names":["Menu_default","createDebug","NextDropdownItem","NextDropdown","NextDropdownTrigger","cn","NextDropdownMenu","NextDropdownSection","Menu_default"]}
@@ -0,0 +1,7 @@
1
+ import Menu from './Menu.cjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+
6
+
7
+ export { Menu as default };
@@ -0,0 +1,7 @@
1
+ import Menu from './Menu.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+
6
+
7
+ export { Menu as default };
@@ -0,0 +1,10 @@
1
+ import {
2
+ Menu_default
3
+ } from "../chunk-6ZUWYBMG.js";
4
+
5
+ // src/Menu/index.ts
6
+ var Menu_default2 = Menu_default;
7
+ export {
8
+ Menu_default2 as default
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Menu/index.ts"],"sourcesContent":["import Menu from './Menu';\n\nexport default Menu;\n"],"mappings":";;;;;AAEA,IAAOA,gBAAQ;","names":["Menu_default"]}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/Modal/Modal.tsx
31
+ var Modal_exports = {};
32
+ __export(Modal_exports, {
33
+ ModalSizeOptions: () => ModalSizeOptions,
34
+ default: () => Modal_default
35
+ });
36
+ module.exports = __toCommonJS(Modal_exports);
37
+ var import_modal = require("@nextui-org/modal");
38
+ var import_classnames = __toESM(require("classnames"), 1);
39
+ var import_debug = __toESM(require("debug"), 1);
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var debug = (0, import_debug.default)("component:Modal");
42
+ var ModalSizeOptions = ["sm", "md", "lg"];
43
+ var Modal = ({
44
+ children = null,
45
+ className = void 0,
46
+ footer = void 0,
47
+ isOpen,
48
+ onClose,
49
+ size = "md",
50
+ testId = void 0,
51
+ title = void 0
52
+ }) => {
53
+ debug("Modal", { size });
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(className), "data-testid": testId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ import_modal.Modal,
56
+ {
57
+ backdrop: "opaque",
58
+ classNames: {
59
+ base: (0, import_classnames.default)(
60
+ {
61
+ "lg:w-11/12": size === "lg",
62
+ "w-2/12": size === "sm",
63
+ "w-6/12": size === "md"
64
+ },
65
+ // overwrite !rounded-none from nextui
66
+ "!rounded-lg"
67
+ )
68
+ },
69
+ isOpen,
70
+ onClose,
71
+ scrollBehavior: "inside",
72
+ size: "full",
73
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalContent, { "data-testid": testId ? `${testId}_modal` : "modal", children: () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
74
+ title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalHeader, { children: title }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalBody, { className: "bg-ex-background", children }),
76
+ footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalFooter, { children: footer })
77
+ ] }) })
78
+ }
79
+ ) });
80
+ };
81
+ var Modal_default = Modal;
82
+ // Annotate the CommonJS export names for ESM import in node:
83
+ 0 && (module.exports = {
84
+ ModalSizeOptions
85
+ });
86
+ //# sourceMappingURL=Modal.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Modal/Modal.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n Modal as NextModal,\n ModalBody as NextModalBody,\n ModalContent as NextModalContent,\n ModalFooter as NextModalFooter,\n ModalHeader as NextModalHeader,\n} from '@nextui-org/modal';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nconst debug = createDebug('component:Modal');\n\nexport const ModalSizeOptions = ['sm', 'md', 'lg'] as const;\ntype ModalSize = (typeof ModalSizeOptions)[number];\n\nexport interface ModalProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** HTML data-testid attribute used in e2e tests */\n footer?: ReactNode;\n /** open state (controlled) */\n isOpen: boolean;\n /** close event handler */\n onClose: () => void;\n /** modal size */\n size?: ModalSize;\n /** e2e test id */\n testId?: string;\n /** modal header */\n title?: ReactNode;\n}\n\n/**\n * Modal component based on [NextUI Modal](https://nextui.org/docs/components/modal)\n */\nconst Modal = ({\n children = null,\n className = undefined,\n footer = undefined,\n isOpen,\n onClose,\n size = 'md',\n testId = undefined,\n title = undefined,\n}: ModalProps) => {\n debug('Modal', { size });\n return (\n <div className={cn(className)} data-testid={testId}>\n <NextModal\n backdrop=\"opaque\"\n classNames={{\n base: cn(\n {\n 'lg:w-11/12': size === 'lg',\n 'w-2/12': size === 'sm',\n 'w-6/12': size === 'md',\n },\n // overwrite !rounded-none from nextui\n '!rounded-lg',\n ),\n }}\n isOpen={isOpen}\n onClose={onClose}\n scrollBehavior=\"inside\"\n size=\"full\"\n >\n <NextModalContent data-testid={testId ? `${testId}_modal` : 'modal'}>\n {() => (\n <>\n {title && <NextModalHeader>{title}</NextModalHeader>}\n <NextModalBody className=\"bg-ex-background\">\n {children}\n </NextModalBody>\n {footer && <NextModalFooter>{footer}</NextModalFooter>}\n </>\n )}\n </NextModalContent>\n </NextModal>\n </div>\n );\n};\n\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAMO;AACP,wBAAe;AACf,mBAAwB;AA8DZ;AA5DZ,IAAM,YAAQ,aAAAA,SAAY,iBAAiB;AAEpC,IAAM,mBAAmB,CAAC,MAAM,MAAM,IAAI;AAyBjD,IAAM,QAAQ,CAAC;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACV,MAAkB;AAChB,QAAM,SAAS,EAAE,KAAK,CAAC;AACvB,SACE,4CAAC,SAAI,eAAW,kBAAAC,SAAG,SAAS,GAAG,eAAa,QAC1C;AAAA,IAAC,aAAAC;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,YAAY;AAAA,QACV,UAAM,kBAAAD;AAAA,UACJ;AAAA,YACE,cAAc,SAAS;AAAA,YACvB,UAAU,SAAS;AAAA,YACnB,UAAU,SAAS;AAAA,UACrB;AAAA;AAAA,UAEA;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAe;AAAA,MACf,MAAK;AAAA,MAEL,sDAAC,aAAAE,cAAA,EAAiB,eAAa,SAAS,GAAG,MAAM,WAAW,SACzD,gBACC,4EACG;AAAA,iBAAS,4CAAC,aAAAC,aAAA,EAAiB,iBAAM;AAAA,QAClC,4CAAC,aAAAC,WAAA,EAAc,WAAU,oBACtB,UACH;AAAA,QACC,UAAU,4CAAC,aAAAC,aAAA,EAAiB,kBAAO;AAAA,SACtC,GAEJ;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,IAAO,gBAAQ;","names":["createDebug","cn","NextModal","NextModalContent","NextModalHeader","NextModalBody","NextModalFooter"]}
@@ -0,0 +1,29 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ declare const ModalSizeOptions: readonly ["sm", "md", "lg"];
5
+ type ModalSize = (typeof ModalSizeOptions)[number];
6
+ interface ModalProps {
7
+ /** child components */
8
+ children?: ReactNode;
9
+ /** CSS class name */
10
+ className?: string | string[];
11
+ /** HTML data-testid attribute used in e2e tests */
12
+ footer?: ReactNode;
13
+ /** open state (controlled) */
14
+ isOpen: boolean;
15
+ /** close event handler */
16
+ onClose: () => void;
17
+ /** modal size */
18
+ size?: ModalSize;
19
+ /** e2e test id */
20
+ testId?: string;
21
+ /** modal header */
22
+ title?: ReactNode;
23
+ }
24
+ /**
25
+ * Modal component based on [NextUI Modal](https://nextui.org/docs/components/modal)
26
+ */
27
+ declare const Modal: ({ children, className, footer, isOpen, onClose, size, testId, title, }: ModalProps) => react_jsx_runtime.JSX.Element;
28
+
29
+ export { type ModalProps, ModalSizeOptions, Modal as default };
@@ -0,0 +1,29 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ declare const ModalSizeOptions: readonly ["sm", "md", "lg"];
5
+ type ModalSize = (typeof ModalSizeOptions)[number];
6
+ interface ModalProps {
7
+ /** child components */
8
+ children?: ReactNode;
9
+ /** CSS class name */
10
+ className?: string | string[];
11
+ /** HTML data-testid attribute used in e2e tests */
12
+ footer?: ReactNode;
13
+ /** open state (controlled) */
14
+ isOpen: boolean;
15
+ /** close event handler */
16
+ onClose: () => void;
17
+ /** modal size */
18
+ size?: ModalSize;
19
+ /** e2e test id */
20
+ testId?: string;
21
+ /** modal header */
22
+ title?: ReactNode;
23
+ }
24
+ /**
25
+ * Modal component based on [NextUI Modal](https://nextui.org/docs/components/modal)
26
+ */
27
+ declare const Modal: ({ children, className, footer, isOpen, onClose, size, testId, title, }: ModalProps) => react_jsx_runtime.JSX.Element;
28
+
29
+ export { type ModalProps, ModalSizeOptions, Modal as default };
@@ -0,0 +1,9 @@
1
+ import {
2
+ ModalSizeOptions,
3
+ Modal_default
4
+ } from "../chunk-EYUTNORZ.js";
5
+ export {
6
+ ModalSizeOptions,
7
+ Modal_default as default
8
+ };
9
+ //# sourceMappingURL=Modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/Modal/index.ts
31
+ var Modal_exports = {};
32
+ __export(Modal_exports, {
33
+ default: () => Modal_default2
34
+ });
35
+ module.exports = __toCommonJS(Modal_exports);
36
+
37
+ // src/Modal/Modal.tsx
38
+ var import_modal = require("@nextui-org/modal");
39
+ var import_classnames = __toESM(require("classnames"), 1);
40
+ var import_debug = __toESM(require("debug"), 1);
41
+ var import_jsx_runtime = require("react/jsx-runtime");
42
+ var debug = (0, import_debug.default)("component:Modal");
43
+ var Modal = ({
44
+ children = null,
45
+ className = void 0,
46
+ footer = void 0,
47
+ isOpen,
48
+ onClose,
49
+ size = "md",
50
+ testId = void 0,
51
+ title = void 0
52
+ }) => {
53
+ debug("Modal", { size });
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_classnames.default)(className), "data-testid": testId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ import_modal.Modal,
56
+ {
57
+ backdrop: "opaque",
58
+ classNames: {
59
+ base: (0, import_classnames.default)(
60
+ {
61
+ "lg:w-11/12": size === "lg",
62
+ "w-2/12": size === "sm",
63
+ "w-6/12": size === "md"
64
+ },
65
+ // overwrite !rounded-none from nextui
66
+ "!rounded-lg"
67
+ )
68
+ },
69
+ isOpen,
70
+ onClose,
71
+ scrollBehavior: "inside",
72
+ size: "full",
73
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalContent, { "data-testid": testId ? `${testId}_modal` : "modal", children: () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
74
+ title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalHeader, { children: title }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalBody, { className: "bg-ex-background", children }),
76
+ footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_modal.ModalFooter, { children: footer })
77
+ ] }) })
78
+ }
79
+ ) });
80
+ };
81
+ var Modal_default = Modal;
82
+
83
+ // src/Modal/index.ts
84
+ var Modal_default2 = Modal_default;
85
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Modal/index.ts","../../src/Modal/Modal.tsx"],"sourcesContent":["import Modal from './Modal';\n\nexport default Modal;\n","import type { ReactNode } from 'react';\n\nimport {\n Modal as NextModal,\n ModalBody as NextModalBody,\n ModalContent as NextModalContent,\n ModalFooter as NextModalFooter,\n ModalHeader as NextModalHeader,\n} from '@nextui-org/modal';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nconst debug = createDebug('component:Modal');\n\nexport const ModalSizeOptions = ['sm', 'md', 'lg'] as const;\ntype ModalSize = (typeof ModalSizeOptions)[number];\n\nexport interface ModalProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** HTML data-testid attribute used in e2e tests */\n footer?: ReactNode;\n /** open state (controlled) */\n isOpen: boolean;\n /** close event handler */\n onClose: () => void;\n /** modal size */\n size?: ModalSize;\n /** e2e test id */\n testId?: string;\n /** modal header */\n title?: ReactNode;\n}\n\n/**\n * Modal component based on [NextUI Modal](https://nextui.org/docs/components/modal)\n */\nconst Modal = ({\n children = null,\n className = undefined,\n footer = undefined,\n isOpen,\n onClose,\n size = 'md',\n testId = undefined,\n title = undefined,\n}: ModalProps) => {\n debug('Modal', { size });\n return (\n <div className={cn(className)} data-testid={testId}>\n <NextModal\n backdrop=\"opaque\"\n classNames={{\n base: cn(\n {\n 'lg:w-11/12': size === 'lg',\n 'w-2/12': size === 'sm',\n 'w-6/12': size === 'md',\n },\n // overwrite !rounded-none from nextui\n '!rounded-lg',\n ),\n }}\n isOpen={isOpen}\n onClose={onClose}\n scrollBehavior=\"inside\"\n size=\"full\"\n >\n <NextModalContent data-testid={testId ? `${testId}_modal` : 'modal'}>\n {() => (\n <>\n {title && <NextModalHeader>{title}</NextModalHeader>}\n <NextModalBody className=\"bg-ex-background\">\n {children}\n </NextModalBody>\n {footer && <NextModalFooter>{footer}</NextModalFooter>}\n </>\n )}\n </NextModalContent>\n </NextModal>\n </div>\n );\n};\n\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACEA,mBAMO;AACP,wBAAe;AACf,mBAAwB;AA8DZ;AA5DZ,IAAM,YAAQ,aAAAC,SAAY,iBAAiB;AA2B3C,IAAM,QAAQ,CAAC;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACV,MAAkB;AAChB,QAAM,SAAS,EAAE,KAAK,CAAC;AACvB,SACE,4CAAC,SAAI,eAAW,kBAAAC,SAAG,SAAS,GAAG,eAAa,QAC1C;AAAA,IAAC,aAAAC;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,YAAY;AAAA,QACV,UAAM,kBAAAD;AAAA,UACJ;AAAA,YACE,cAAc,SAAS;AAAA,YACvB,UAAU,SAAS;AAAA,YACnB,UAAU,SAAS;AAAA,UACrB;AAAA;AAAA,UAEA;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAe;AAAA,MACf,MAAK;AAAA,MAEL,sDAAC,aAAAE,cAAA,EAAiB,eAAa,SAAS,GAAG,MAAM,WAAW,SACzD,gBACC,4EACG;AAAA,iBAAS,4CAAC,aAAAC,aAAA,EAAiB,iBAAM;AAAA,QAClC,4CAAC,aAAAC,WAAA,EAAc,WAAU,oBACtB,UACH;AAAA,QACC,UAAU,4CAAC,aAAAC,aAAA,EAAiB,kBAAO;AAAA,SACtC,GAEJ;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,IAAO,gBAAQ;;;ADpFf,IAAOC,iBAAQ;","names":["Modal_default","createDebug","cn","NextModal","NextModalContent","NextModalHeader","NextModalBody","NextModalFooter","Modal_default"]}
@@ -0,0 +1,7 @@
1
+ import Modal from './Modal.cjs';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+
6
+
7
+ export { Modal as default };
@@ -0,0 +1,7 @@
1
+ import Modal from './Modal.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+
5
+
6
+
7
+ export { Modal as default };
@@ -0,0 +1,10 @@
1
+ import {
2
+ Modal_default
3
+ } from "../chunk-EYUTNORZ.js";
4
+
5
+ // src/Modal/index.ts
6
+ var Modal_default2 = Modal_default;
7
+ export {
8
+ Modal_default2 as default
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Modal/index.ts"],"sourcesContent":["import Modal from './Modal';\n\nexport default Modal;\n"],"mappings":";;;;;AAEA,IAAOA,iBAAQ;","names":["Modal_default"]}