@papernote/ui 1.10.1 → 1.10.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.
@@ -86,7 +86,7 @@ export interface ModalProps {
86
86
  * </Modal>
87
87
  * ```
88
88
  */
89
- export default function Modal({ isOpen, onClose, title, children, size, showCloseButton, animation, scrollable, maxHeight, mobileMode, mobileHeight, mobileShowHandle, }: ModalProps): import("react/jsx-runtime").JSX.Element | null;
89
+ export default function Modal({ isOpen, onClose, title, children, size, showCloseButton, animation, scrollable, maxHeight, mobileMode, mobileHeight, mobileShowHandle, }: ModalProps): React.ReactPortal | null;
90
90
  export declare function ModalFooter({ children }: {
91
91
  children: React.ReactNode;
92
92
  }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAKxD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;IAClE,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,yHAAyH;IACzH,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACxC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,GAA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AG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAC3C,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAW,EACX,eAAsB,EACtB,SAAmB,EACnB,UAAkB,EAClB,SAAS,EACT,UAAmB,EACnB,YAAmB,EACnB,gBAAuB,GACxB,EAAE,UAAU,4BAkIZ;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAMtE"}
package/dist/index.d.ts CHANGED
@@ -1451,7 +1451,7 @@ interface ModalProps {
1451
1451
  * </Modal>
1452
1452
  * ```
1453
1453
  */
1454
- declare function Modal({ isOpen, onClose, title, children, size, showCloseButton, animation, scrollable, maxHeight, mobileMode, mobileHeight, mobileShowHandle, }: ModalProps): react_jsx_runtime.JSX.Element | null;
1454
+ declare function Modal({ isOpen, onClose, title, children, size, showCloseButton, animation, scrollable, maxHeight, mobileMode, mobileHeight, mobileShowHandle, }: ModalProps): React__default.ReactPortal | null;
1455
1455
  declare function ModalFooter({ children }: {
1456
1456
  children: React__default.ReactNode;
1457
1457
  }): react_jsx_runtime.JSX.Element;
package/dist/index.esm.js CHANGED
@@ -3453,12 +3453,13 @@ function Modal({ isOpen, onClose, title, children, size = 'md', showCloseButton
3453
3453
  return null;
3454
3454
  // Render as BottomSheet on mobile
3455
3455
  if (useBottomSheet) {
3456
- return (jsx(BottomSheet, { isOpen: isOpen, onClose: onClose, title: title, height: mobileHeight, showHandle: mobileShowHandle, showCloseButton: showCloseButton, children: children }));
3456
+ return createPortal(jsx(BottomSheet, { isOpen: isOpen, onClose: onClose, title: title, height: mobileHeight, showHandle: mobileShowHandle, showCloseButton: showCloseButton, children: children }), document.body);
3457
3457
  }
3458
3458
  // Render as standard modal on desktop
3459
- return (jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-ink-900 bg-opacity-50 backdrop-blur-sm animate-fade-in", onMouseDown: handleBackdropMouseDown, onClick: handleBackdropClick, children: jsxs("div", { ref: modalRef, className: `${sizeClasses$8[size]} w-full bg-white bg-subtle-grain rounded-xl shadow-2xl border border-paper-200 ${getAnimationClass()}`, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, children: [jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-paper-200", children: [jsx("h3", { id: titleId, className: "text-lg font-medium text-ink-900", children: title }), showCloseButton && (jsx("button", { onClick: onClose, className: "text-ink-400 hover:text-ink-600 transition-colors", "aria-label": "Close modal", children: jsx(X, { className: "h-5 w-5" }) }))] }), jsx("div", { className: `px-6 py-4 ${scrollable || maxHeight ? 'overflow-y-auto' : ''}`, style: {
3459
+ const modalContent = (jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-ink-900 bg-opacity-50 backdrop-blur-sm animate-fade-in", onMouseDown: handleBackdropMouseDown, onClick: handleBackdropClick, children: jsxs("div", { ref: modalRef, className: `${sizeClasses$8[size]} w-full bg-white bg-subtle-grain rounded-xl shadow-2xl border border-paper-200 ${getAnimationClass()}`, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, children: [jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-paper-200", children: [jsx("h3", { id: titleId, className: "text-lg font-medium text-ink-900", children: title }), showCloseButton && (jsx("button", { onClick: onClose, className: "text-ink-400 hover:text-ink-600 transition-colors", "aria-label": "Close modal", children: jsx(X, { className: "h-5 w-5" }) }))] }), jsx("div", { className: `px-6 py-4 ${scrollable || maxHeight ? 'overflow-y-auto' : ''}`, style: {
3460
3460
  maxHeight: maxHeight || (scrollable ? 'calc(100vh - 200px)' : undefined),
3461
3461
  }, children: children })] }) }));
3462
+ return createPortal(modalContent, document.body);
3462
3463
  }
3463
3464
  function ModalFooter({ children }) {
3464
3465
  return (jsx("div", { className: "flex items-center justify-end gap-3 px-6 py-4 border-t border-paper-200 bg-paper-50 -mx-6 -mb-4 mt-4 rounded-b-xl", children: children }));
@@ -11596,44 +11597,52 @@ function getAugmentedNamespace(n) {
11596
11597
  * (A1, A1:C5, ...)
11597
11598
  */
11598
11599
 
11599
- let Collection$3 = class Collection {
11600
+ var collection;
11601
+ var hasRequiredCollection;
11602
+
11603
+ function requireCollection () {
11604
+ if (hasRequiredCollection) return collection;
11605
+ hasRequiredCollection = 1;
11606
+ class Collection {
11600
11607
 
11601
- constructor(data, refs) {
11602
- if (data == null && refs == null) {
11603
- this._data = [];
11604
- this._refs = [];
11605
- } else {
11606
- if (data.length !== refs.length)
11607
- throw Error('Collection: data length should match references length.');
11608
- this._data = data;
11609
- this._refs = refs;
11610
- }
11611
- }
11608
+ constructor(data, refs) {
11609
+ if (data == null && refs == null) {
11610
+ this._data = [];
11611
+ this._refs = [];
11612
+ } else {
11613
+ if (data.length !== refs.length)
11614
+ throw Error('Collection: data length should match references length.');
11615
+ this._data = data;
11616
+ this._refs = refs;
11617
+ }
11618
+ }
11612
11619
 
11613
- get data() {
11614
- return this._data;
11615
- }
11620
+ get data() {
11621
+ return this._data;
11622
+ }
11616
11623
 
11617
- get refs() {
11618
- return this._refs;
11619
- }
11624
+ get refs() {
11625
+ return this._refs;
11626
+ }
11620
11627
 
11621
- get length() {
11622
- return this._data.length;
11623
- }
11628
+ get length() {
11629
+ return this._data.length;
11630
+ }
11624
11631
 
11625
- /**
11626
- * Add data and references to this collection.
11627
- * @param {{}} obj - data
11628
- * @param {{}} ref - reference
11629
- */
11630
- add(obj, ref) {
11631
- this._data.push(obj);
11632
- this._refs.push(ref);
11633
- }
11634
- };
11632
+ /**
11633
+ * Add data and references to this collection.
11634
+ * @param {{}} obj - data
11635
+ * @param {{}} ref - reference
11636
+ */
11637
+ add(obj, ref) {
11638
+ this._data.push(obj);
11639
+ this._refs.push(ref);
11640
+ }
11641
+ }
11635
11642
 
11636
- var collection = Collection$3;
11643
+ collection = Collection;
11644
+ return collection;
11645
+ }
11637
11646
 
11638
11647
  var helpers;
11639
11648
  var hasRequiredHelpers;
@@ -11642,7 +11651,7 @@ function requireHelpers () {
11642
11651
  if (hasRequiredHelpers) return helpers;
11643
11652
  hasRequiredHelpers = 1;
11644
11653
  const FormulaError = requireError();
11645
- const Collection = collection;
11654
+ const Collection = requireCollection();
11646
11655
 
11647
11656
  const Types = {
11648
11657
  NUMBER: 0,
@@ -21296,7 +21305,7 @@ var engineering = EngineeringFunctions;
21296
21305
 
21297
21306
  const FormulaError$b = requireError();
21298
21307
  const {FormulaHelpers: FormulaHelpers$8, Types: Types$6, WildCard, Address: Address$3} = requireHelpers();
21299
- const Collection$2 = collection;
21308
+ const Collection$2 = requireCollection();
21300
21309
  const H$5 = FormulaHelpers$8;
21301
21310
 
21302
21311
  const ReferenceFunctions$1 = {
@@ -32924,7 +32933,7 @@ var parsing = {
32924
32933
  const FormulaError$4 = requireError();
32925
32934
  const {Address: Address$1} = requireHelpers();
32926
32935
  const {Prefix: Prefix$1, Postfix: Postfix$1, Infix: Infix$1, Operators: Operators$1} = operators;
32927
- const Collection$1 = collection;
32936
+ const Collection$1 = requireCollection();
32928
32937
  const MAX_ROW$1 = 1048576, MAX_COLUMN$1 = 16384;
32929
32938
  const {NotAllInputParsedException} = require$$4;
32930
32939
 
@@ -33686,7 +33695,7 @@ var hooks$1 = {
33686
33695
  const FormulaError$2 = requireError();
33687
33696
  const {FormulaHelpers: FormulaHelpers$1, Types, Address} = requireHelpers();
33688
33697
  const {Prefix, Postfix, Infix, Operators} = operators;
33689
- const Collection = collection;
33698
+ const Collection = requireCollection();
33690
33699
  const MAX_ROW = 1048576, MAX_COLUMN = 16384;
33691
33700
 
33692
33701
  let Utils$1 = class Utils {