@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
package/dist/index.js
CHANGED
|
@@ -3473,12 +3473,13 @@ function Modal({ isOpen, onClose, title, children, size = 'md', showCloseButton
|
|
|
3473
3473
|
return null;
|
|
3474
3474
|
// Render as BottomSheet on mobile
|
|
3475
3475
|
if (useBottomSheet) {
|
|
3476
|
-
return (jsxRuntime.jsx(BottomSheet, { isOpen: isOpen, onClose: onClose, title: title, height: mobileHeight, showHandle: mobileShowHandle, showCloseButton: showCloseButton, children: children }));
|
|
3476
|
+
return reactDom.createPortal(jsxRuntime.jsx(BottomSheet, { isOpen: isOpen, onClose: onClose, title: title, height: mobileHeight, showHandle: mobileShowHandle, showCloseButton: showCloseButton, children: children }), document.body);
|
|
3477
3477
|
}
|
|
3478
3478
|
// Render as standard modal on desktop
|
|
3479
|
-
|
|
3479
|
+
const modalContent = (jsxRuntime.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: jsxRuntime.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: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-paper-200", children: [jsxRuntime.jsx("h3", { id: titleId, className: "text-lg font-medium text-ink-900", children: title }), showCloseButton && (jsxRuntime.jsx("button", { onClick: onClose, className: "text-ink-400 hover:text-ink-600 transition-colors", "aria-label": "Close modal", children: jsxRuntime.jsx(lucideReact.X, { className: "h-5 w-5" }) }))] }), jsxRuntime.jsx("div", { className: `px-6 py-4 ${scrollable || maxHeight ? 'overflow-y-auto' : ''}`, style: {
|
|
3480
3480
|
maxHeight: maxHeight || (scrollable ? 'calc(100vh - 200px)' : undefined),
|
|
3481
3481
|
}, children: children })] }) }));
|
|
3482
|
+
return reactDom.createPortal(modalContent, document.body);
|
|
3482
3483
|
}
|
|
3483
3484
|
function ModalFooter({ children }) {
|
|
3484
3485
|
return (jsxRuntime.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 }));
|
|
@@ -8191,7 +8192,7 @@ function Breadcrumbs({ items, showHome = true }) {
|
|
|
8191
8192
|
})] }));
|
|
8192
8193
|
}
|
|
8193
8194
|
|
|
8194
|
-
function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, className = '', dot = false, pill = false, }) {
|
|
8195
|
+
function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, className = '', dot = false, pill = false, truncate = false, maxWidth, }) {
|
|
8195
8196
|
const variantStyles = {
|
|
8196
8197
|
success: 'bg-success-50 text-success-700 border-success-200',
|
|
8197
8198
|
warning: 'bg-warning-50 text-warning-700 border-warning-200',
|
|
@@ -8238,12 +8239,13 @@ function Badge({ children, variant = 'neutral', size = 'md', icon, onRemove, cla
|
|
|
8238
8239
|
}
|
|
8239
8240
|
// Regular badge
|
|
8240
8241
|
return (jsxRuntime.jsxs("span", { className: `
|
|
8241
|
-
inline-flex items-center border font-medium
|
|
8242
|
+
inline-flex items-center border font-medium whitespace-nowrap
|
|
8242
8243
|
${pill ? 'rounded-full' : 'rounded-full'}
|
|
8243
8244
|
${variantStyles[variant]}
|
|
8244
8245
|
${pill ? pillSizeStyles[size] : sizeStyles[size]}
|
|
8246
|
+
${truncate ? 'max-w-full overflow-hidden' : ''}
|
|
8245
8247
|
${className}
|
|
8246
|
-
`, children: [icon && jsxRuntime.jsx("span", { className: iconSize[size]
|
|
8248
|
+
`, style: maxWidth ? { maxWidth } : undefined, children: [icon && jsxRuntime.jsx("span", { className: `${iconSize[size]} flex-shrink-0`, children: icon }), jsxRuntime.jsx("span", { className: truncate ? 'truncate' : '', children: children }), onRemove && (jsxRuntime.jsx("button", { onClick: onRemove, className: "ml-1 hover:opacity-70 transition-opacity flex-shrink-0", "aria-label": "Remove badge", children: jsxRuntime.jsx(lucideReact.X, { className: iconSize[size] }) }))] }));
|
|
8247
8249
|
}
|
|
8248
8250
|
|
|
8249
8251
|
const TabsContext = React.createContext(null);
|