@papernote/ui 1.10.1 → 1.10.3
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/components/Badge.d.ts +5 -1
- package/dist/components/Badge.d.ts.map +1 -1
- package/dist/components/Modal.d.ts +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.esm.js +7 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Badge.tsx +12 -4
- package/src/components/Modal.tsx +7 -3
|
@@ -10,6 +10,10 @@ export interface BadgeProps {
|
|
|
10
10
|
dot?: boolean;
|
|
11
11
|
/** Use pill shape (more rounded, compact padding) for inline use */
|
|
12
12
|
pill?: boolean;
|
|
13
|
+
/** Truncate text with ellipsis if it overflows (requires maxWidth) */
|
|
14
|
+
truncate?: boolean;
|
|
15
|
+
/** Maximum width for the badge (useful with truncate), e.g. '150px' or '10rem' */
|
|
16
|
+
maxWidth?: string;
|
|
13
17
|
}
|
|
14
|
-
export default function Badge({ children, variant, size, icon, onRemove, className, dot, pill, }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default function Badge({ children, variant, size, icon, onRemove, className, dot, pill, truncate, maxWidth, }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
15
19
|
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,QAAQ,EACR,OAAmB,EACnB,IAAW,EACX,IAAI,EACJ,QAAQ,EACR,SAAc,EACd,GAAW,EACX,IAAY,EACZ,QAAgB,EAChB,QAAQ,GACT,EAAE,UAAU,2CAmFZ"}
|
|
@@ -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):
|
|
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;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAMxD,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,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):
|
|
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;
|
|
@@ -3251,8 +3251,12 @@ interface BadgeProps {
|
|
|
3251
3251
|
dot?: boolean;
|
|
3252
3252
|
/** Use pill shape (more rounded, compact padding) for inline use */
|
|
3253
3253
|
pill?: boolean;
|
|
3254
|
+
/** Truncate text with ellipsis if it overflows (requires maxWidth) */
|
|
3255
|
+
truncate?: boolean;
|
|
3256
|
+
/** Maximum width for the badge (useful with truncate), e.g. '150px' or '10rem' */
|
|
3257
|
+
maxWidth?: string;
|
|
3254
3258
|
}
|
|
3255
|
-
declare function Badge({ children, variant, size, icon, onRemove, className, dot, pill, }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
3259
|
+
declare function Badge({ children, variant, size, icon, onRemove, className, dot, pill, truncate, maxWidth, }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
3256
3260
|
|
|
3257
3261
|
interface AvatarProps {
|
|
3258
3262
|
/** User's first name (for initials) */
|
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
|
-
|
|
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 }));
|
|
@@ -8171,7 +8172,7 @@ function Breadcrumbs({ items, showHome = true }) {
|
|
|
8171
8172
|
})] }));
|
|
8172
8173
|
}
|
|
8173
8174
|
|
|
8174
|
-
function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, className = '', dot = false, pill = false, }) {
|
|
8175
|
+
function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, className = '', dot = false, pill = false, truncate = false, maxWidth, }) {
|
|
8175
8176
|
const variantStyles = {
|
|
8176
8177
|
success: 'bg-success-50 text-success-700 border-success-200',
|
|
8177
8178
|
warning: 'bg-warning-50 text-warning-700 border-warning-200',
|
|
@@ -8218,12 +8219,13 @@ function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, cla
|
|
|
8218
8219
|
}
|
|
8219
8220
|
// Regular badge
|
|
8220
8221
|
return (jsxs("span", { className: `
|
|
8221
|
-
inline-flex items-center border font-medium
|
|
8222
|
+
inline-flex items-center border font-medium whitespace-nowrap
|
|
8222
8223
|
${pill ? 'rounded-full' : 'rounded-full'}
|
|
8223
8224
|
${variantStyles[variant]}
|
|
8224
8225
|
${pill ? pillSizeStyles[size] : sizeStyles[size]}
|
|
8226
|
+
${truncate ? 'max-w-full overflow-hidden' : ''}
|
|
8225
8227
|
${className}
|
|
8226
|
-
`, children: [icon && jsx("span", { className: iconSize[size]
|
|
8228
|
+
`, style: maxWidth ? { maxWidth } : undefined, children: [icon && jsx("span", { className: `${iconSize[size]} flex-shrink-0`, children: icon }), jsx("span", { className: truncate ? 'truncate' : '', children: children }), onRemove && (jsx("button", { onClick: onRemove, className: "ml-1 hover:opacity-70 transition-opacity flex-shrink-0", "aria-label": "Remove badge", children: jsx(X, { className: iconSize[size] }) }))] }));
|
|
8227
8229
|
}
|
|
8228
8230
|
|
|
8229
8231
|
const TabsContext = createContext$1(null);
|