@papernote/ui 1.14.0 → 2.0.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.
- package/dist/index.esm.js +13 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/styles.css +6228 -6717
- package/package.json +6 -4
- package/src/components/AdminModal.tsx +1 -1
- package/src/components/Autocomplete.tsx +1 -1
- package/src/components/CommandPalette.tsx +2 -2
- package/src/components/DataTable.tsx +1 -1
- package/src/components/Drawer.tsx +1 -1
- package/src/components/MarkdownEditor.tsx +1 -1
- package/src/components/MaskedInput.tsx +1 -1
- package/src/components/Modal.tsx +1 -1
- package/src/components/NotificationBar.tsx +2 -2
- package/src/components/PasswordInput.tsx +1 -1
- package/src/components/SearchBar.tsx +1 -1
- package/src/components/Textarea.tsx +1 -1
- package/src/styles/index.css +50 -160
- package/src/styles/theme.css +302 -0
package/dist/index.esm.js
CHANGED
|
@@ -1257,7 +1257,7 @@ const Textarea = forwardRef(({ label, helperText, validationState, validationMes
|
|
|
1257
1257
|
}
|
|
1258
1258
|
};
|
|
1259
1259
|
return (jsxs("div", { className: "w-full", children: [label && (jsxs("label", { htmlFor: textareaId, className: "label", children: [label, props.required && jsx("span", { className: "text-error-500 ml-1", children: "*" })] })), jsxs("div", { className: "relative", children: [jsx("textarea", { ref: textareaRef, id: textareaId, value: value, maxLength: maxLength, rows: autoExpand ? minRows : rows, enterKeyHint: enterKeyHint, className: `
|
|
1260
|
-
block w-full border rounded-lg text-ink-800 placeholder-ink-400
|
|
1260
|
+
block w-full border rounded-lg text-ink-800 placeholder:text-ink-400
|
|
1261
1261
|
bg-white bg-subtle-grain transition-all duration-200
|
|
1262
1262
|
focus:outline-none focus:ring-2 ${getResizeClass()}
|
|
1263
1263
|
disabled:bg-paper-100 disabled:text-ink-400 disabled:cursor-not-allowed disabled:opacity-60
|
|
@@ -5053,7 +5053,7 @@ function Modal({ isOpen, onClose, title, children, size = 'md', showCloseButton
|
|
|
5053
5053
|
return createPortal(jsx(BottomSheet, { isOpen: isOpen, onClose: onClose, title: title, height: mobileHeight, showHandle: mobileShowHandle, showCloseButton: showCloseButton, children: children }), document.body);
|
|
5054
5054
|
}
|
|
5055
5055
|
// Render as standard modal on desktop
|
|
5056
|
-
const modalContent = (jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-ink-900
|
|
5056
|
+
const modalContent = (jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-ink-900/50 backdrop-blur-sm animate-fade-in", onMouseDown: handleBackdropMouseDown, onClick: handleBackdropClick, children: jsxs("div", { ref: modalRef, className: `${sizeClasses$a[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, tabIndex: -1, 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: {
|
|
5057
5057
|
maxHeight: maxHeight || (scrollable ? 'calc(100vh - 200px)' : undefined),
|
|
5058
5058
|
}, children: children })] }) }));
|
|
5059
5059
|
return createPortal(modalContent, document.body);
|
|
@@ -6201,7 +6201,7 @@ function Drawer({ isOpen, onClose, title, children, placement = 'right', size =
|
|
|
6201
6201
|
if (!isOpen)
|
|
6202
6202
|
return null;
|
|
6203
6203
|
const isHorizontal = placement === 'left' || placement === 'right';
|
|
6204
|
-
return (jsxs("div", { className: "fixed inset-0 z-50 flex", children: [showOverlay && (jsx("div", { className: "fixed inset-0 bg-ink-900
|
|
6204
|
+
return (jsxs("div", { className: "fixed inset-0 z-50 flex", children: [showOverlay && (jsx("div", { className: "fixed inset-0 bg-ink-900/50 backdrop-blur-sm animate-fade-in", onClick: handleOverlayClick, "aria-hidden": "true" })), jsxs("div", { className: `
|
|
6205
6205
|
fixed ${placementClasses[placement]}
|
|
6206
6206
|
${sizeClasses$9[placement][size]}
|
|
6207
6207
|
bg-white border-paper-200 shadow-2xl
|
|
@@ -6754,10 +6754,10 @@ function CommandPalette({ commands, open, onOpenChange, placeholder = 'Type a co
|
|
|
6754
6754
|
};
|
|
6755
6755
|
if (!open)
|
|
6756
6756
|
return null;
|
|
6757
|
-
return createPortal(jsxs("div", { className: "fixed inset-0 z-50 flex items-start justify-center pt-[20vh] animate-fade-in", children: [jsx("div", { className: "absolute inset-0 bg-ink-900
|
|
6757
|
+
return createPortal(jsxs("div", { className: "fixed inset-0 z-50 flex items-start justify-center pt-[20vh] animate-fade-in", children: [jsx("div", { className: "absolute inset-0 bg-ink-900/50 backdrop-blur-sm", onClick: () => onOpenChange(false) }), jsxs("div", { className: "relative w-full max-w-2xl mx-4 bg-white rounded-xl shadow-2xl border border-paper-200 overflow-hidden animate-scale-in", children: [jsxs("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-paper-200", children: [jsx(Search, { className: "h-5 w-5 text-ink-400" }), jsx("input", { ref: inputRef, type: "text", value: searchQuery, onChange: (e) => {
|
|
6758
6758
|
setSearchQuery(e.target.value);
|
|
6759
6759
|
setSelectedIndex(0);
|
|
6760
|
-
}, placeholder: placeholder, className: "flex-1 text-base text-ink-900 placeholder-ink-400 bg-transparent border-none outline-none" }), trigger && (jsx("kbd", { className: "hidden sm:inline-block px-2 py-1 text-xs font-mono text-ink-500 bg-paper-100 border border-paper-300 rounded", children: trigger }))] }), jsx("div", { ref: listRef, className: "max-h-[400px] overflow-y-auto py-2", children: flatCommands.length === 0 ? (jsx("div", { className: "px-4 py-8 text-center text-sm text-ink-500", children: "No commands found" })) : (jsxs(Fragment, { children: [Object.entries(grouped).map(([groupName, groupCommands]) => (jsxs("div", { children: [jsx("div", { className: "px-4 py-1.5 text-xs font-semibold text-ink-500 uppercase tracking-wider", children: groupName }), groupCommands.map((command) => {
|
|
6760
|
+
}, placeholder: placeholder, className: "flex-1 text-base text-ink-900 placeholder:text-ink-400 bg-transparent border-none outline-none" }), trigger && (jsx("kbd", { className: "hidden sm:inline-block px-2 py-1 text-xs font-mono text-ink-500 bg-paper-100 border border-paper-300 rounded", children: trigger }))] }), jsx("div", { ref: listRef, className: "max-h-[400px] overflow-y-auto py-2", children: flatCommands.length === 0 ? (jsx("div", { className: "px-4 py-8 text-center text-sm text-ink-500", children: "No commands found" })) : (jsxs(Fragment, { children: [Object.entries(grouped).map(([groupName, groupCommands]) => (jsxs("div", { children: [jsx("div", { className: "px-4 py-1.5 text-xs font-semibold text-ink-500 uppercase tracking-wider", children: groupName }), groupCommands.map((command) => {
|
|
6761
6761
|
const globalIndex = flatCommands.indexOf(command);
|
|
6762
6762
|
const isSelected = globalIndex === selectedIndex;
|
|
6763
6763
|
return (jsxs("button", { "data-index": globalIndex, onClick: () => executeCommand(command), onMouseEnter: () => setSelectedIndex(globalIndex), className: `
|
|
@@ -7699,7 +7699,7 @@ const PasswordInput = forwardRef(({ value, onChange, label, placeholder = 'Enter
|
|
|
7699
7699
|
}, [value, requirements]);
|
|
7700
7700
|
return (jsxs("div", { className: className, children: [label && (jsxs("label", { className: "block text-sm font-medium text-ink-900 mb-1.5", children: [label, required && jsx("span", { className: "text-error-500 ml-1", children: "*" })] })), jsxs("div", { className: "relative", children: [jsx("input", { ref: inputRef, type: showPassword ? 'text' : 'password', value: value, onChange: (e) => onChange(e.target.value), placeholder: placeholder, disabled: disabled, className: `
|
|
7701
7701
|
w-full px-3 py-2 pr-10
|
|
7702
|
-
text-sm text-ink-900 placeholder-ink-400
|
|
7702
|
+
text-sm text-ink-900 placeholder:text-ink-400
|
|
7703
7703
|
bg-white border rounded-lg
|
|
7704
7704
|
focus:outline-none focus:ring-2 focus:ring-accent-400 focus:border-accent-400
|
|
7705
7705
|
disabled:bg-paper-100 disabled:cursor-not-allowed
|
|
@@ -7808,7 +7808,7 @@ const MaskedInput = forwardRef(({ value, onChange, maskType = 'phone', customMas
|
|
|
7808
7808
|
};
|
|
7809
7809
|
return (jsxs("div", { className: className, children: [label && (jsxs("label", { className: "block text-sm font-medium text-ink-900 mb-1.5", children: [label, required && jsx("span", { className: "text-error-500 ml-1", children: "*" })] })), jsx("input", { ref: inputRef, type: "text", value: displayValue, onChange: handleChange, onPaste: handlePaste, placeholder: getPlaceholder(), disabled: disabled, className: `
|
|
7810
7810
|
w-full px-3 py-2
|
|
7811
|
-
text-sm text-ink-900 placeholder-ink-400
|
|
7811
|
+
text-sm text-ink-900 placeholder:text-ink-400
|
|
7812
7812
|
bg-white border rounded-lg
|
|
7813
7813
|
focus:outline-none focus:ring-2 focus:ring-accent-400 focus:border-accent-400
|
|
7814
7814
|
disabled:bg-paper-100 disabled:cursor-not-allowed
|
|
@@ -8023,7 +8023,7 @@ const Autocomplete = forwardRef(({ value, onChange, options = [], onSearch, labe
|
|
|
8023
8023
|
}
|
|
8024
8024
|
}, placeholder: placeholder, disabled: disabled, className: `
|
|
8025
8025
|
w-full pl-9 pr-9 py-2
|
|
8026
|
-
text-sm text-ink-900 placeholder-ink-400
|
|
8026
|
+
text-sm text-ink-900 placeholder:text-ink-400
|
|
8027
8027
|
bg-white border rounded-lg
|
|
8028
8028
|
focus:outline-none focus:ring-2 focus:ring-accent-400 focus:border-accent-400
|
|
8029
8029
|
disabled:bg-paper-100 disabled:cursor-not-allowed
|
|
@@ -8583,7 +8583,7 @@ function MarkdownEditor({ value, onChange, label, placeholder = '# Start writing
|
|
|
8583
8583
|
: 'text-ink-600 hover:bg-white/50'}
|
|
8584
8584
|
`, children: "Split" })] }))] }), showHelp && (jsxs("button", { type: "button", onClick: () => setShowHelpPanel(!showHelpPanel), className: "flex items-center gap-1 px-2 py-1 text-xs text-ink-600 hover:text-ink-900 transition-colors", children: [jsx(Info, { className: "h-3.5 w-3.5" }), "Markdown Help"] }))] }), showHelpPanel && (jsx("div", { className: "p-3 border border-b-0 border-paper-300 bg-accent-50 text-xs", children: jsx("div", { className: "grid grid-cols-2 gap-2", children: helpContent.map((item, index) => (jsxs("div", { className: "flex items-center gap-2", children: [jsx("code", { className: "px-2 py-0.5 bg-white rounded text-ink-900 font-mono", children: item.syntax }), jsx("span", { className: "text-ink-600", children: item.description })] }, index))) }) })), jsxs("div", { className: `flex border border-paper-300 rounded-b-lg overflow-hidden ${mode === 'split' ? '' : ''}`, children: [(mode === 'edit' || mode === 'split') && (jsx("div", { className: `${mode === 'split' ? 'w-1/2 border-r border-paper-300' : 'w-full'}`, children: jsx("textarea", { value: value, onChange: (e) => onChange(e.target.value), placeholder: placeholder, disabled: disabled, className: `
|
|
8585
8585
|
w-full p-3 outline-none resize-none
|
|
8586
|
-
text-sm text-ink-900 font-mono placeholder-ink-400
|
|
8586
|
+
text-sm text-ink-900 font-mono placeholder:text-ink-400
|
|
8587
8587
|
${disabled ? 'bg-paper-100 cursor-not-allowed' : 'bg-white'}
|
|
8588
8588
|
`, style: { minHeight, maxHeight } }) })), (mode === 'preview' || mode === 'split') && (jsx("div", { className: `${mode === 'split' ? 'w-1/2' : 'w-full'} overflow-y-auto bg-white`, children: jsx("div", { className: "p-3 prose prose-sm max-w-none", style: { minHeight, maxHeight }, dangerouslySetInnerHTML: { __html: markdownToHtml(value) } }) }))] }), jsx("style", { children: `
|
|
8589
8589
|
.prose h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 1rem; }
|
|
@@ -14293,7 +14293,7 @@ function SearchBar({ value, onChange, placeholder = 'Search...', className = '',
|
|
|
14293
14293
|
onSearch(value);
|
|
14294
14294
|
}
|
|
14295
14295
|
};
|
|
14296
|
-
return (jsxs("div", { className: `flex-1 max-w-2xl relative ${className}`, children: [jsx("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none", children: jsx(Search, { className: "h-5 w-5 text-ink-400" }) }), jsx("input", { type: "text", value: value, onChange: (e) => onChange(e.target.value), onKeyDown: handleKeyDown, disabled: disabled, className: "block w-full pl-11 pr-4 py-3 border border-paper-300 rounded-lg leading-5 bg-white placeholder-ink-400 text-ink-800 focus:outline-none focus:placeholder-ink-300 focus:ring-2 focus:ring-accent-400 focus:border-accent-400 hover:border-paper-400 transition-all sm:text-sm disabled:bg-paper-100 disabled:cursor-not-allowed", placeholder: placeholder })] }));
|
|
14296
|
+
return (jsxs("div", { className: `flex-1 max-w-2xl relative ${className}`, children: [jsx("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none", children: jsx(Search, { className: "h-5 w-5 text-ink-400" }) }), jsx("input", { type: "text", value: value, onChange: (e) => onChange(e.target.value), onKeyDown: handleKeyDown, disabled: disabled, className: "block w-full pl-11 pr-4 py-3 border border-paper-300 rounded-lg leading-5 bg-white placeholder:text-ink-400 text-ink-800 focus:outline-none focus:placeholder:text-ink-300 focus:ring-2 focus:ring-accent-400 focus:border-accent-400 hover:border-paper-400 transition-all sm:text-sm disabled:bg-paper-100 disabled:cursor-not-allowed", placeholder: placeholder })] }));
|
|
14297
14297
|
}
|
|
14298
14298
|
|
|
14299
14299
|
function NotificationIndicator({ count = 0, onClick, className = '', maxCount = 99, variant = 'default', }) {
|
|
@@ -15665,7 +15665,7 @@ mobileView = 'auto', cardConfig, cardGap = 'md', cardClassName, }) {
|
|
|
15665
15665
|
})()] }, rowKey));
|
|
15666
15666
|
});
|
|
15667
15667
|
};
|
|
15668
|
-
const tableContent = (jsxs("div", { className: `bg-white rounded-lg shadow border-2 ${borderColor} ${virtualized ? 'overflow-hidden' : 'overflow-x-auto overflow-y-visible'} ${className}`, style: { position: 'relative' }, children: [loading && data.length > 0 && (jsx("div", { className: "absolute inset-0 bg-white
|
|
15668
|
+
const tableContent = (jsxs("div", { className: `bg-white rounded-lg shadow border-2 ${borderColor} ${virtualized ? 'overflow-hidden' : 'overflow-x-auto overflow-y-visible'} ${className}`, style: { position: 'relative' }, children: [loading && data.length > 0 && (jsx("div", { className: "absolute inset-0 bg-white/75 flex items-center justify-center z-20", style: { backdropFilter: 'blur(2px)' }, children: jsxs("div", { className: "flex flex-col items-center gap-3", children: [jsx("div", { className: "loading-spinner", style: { width: '32px', height: '32px', borderWidth: '3px' } }), jsx("span", { className: "text-sm font-medium text-ink-600", children: "Loading..." })] }) })), jsxs("table", { className: `table-stable w-full ${bordered ? 'border-collapse' : ''}`, role: "grid", "aria-label": "Data table", "aria-rowcount": data.length, "aria-colcount": visibleColumns.length, children: [jsxs("colgroup", { children: [selectable && jsx("col", { className: "w-12" }), ((expandable || expandedRowConfig) && showExpandChevron) && jsx("col", { className: "w-10" }), allActions.length > 0 && jsx("col", { style: { width: '28px' } }), visibleColumns.map((column, index) => {
|
|
15669
15669
|
const columnKey = String(column.key);
|
|
15670
15670
|
const dynamicWidth = columnWidths[columnKey];
|
|
15671
15671
|
return (jsx("col", { style: getColumnStyle(column, dynamicWidth) }, index));
|
|
@@ -61895,7 +61895,7 @@ function AdminModal({ isOpen, onClose, title, subtitle, onSubmit, isSaving = fal
|
|
|
61895
61895
|
onSubmit(formData);
|
|
61896
61896
|
}
|
|
61897
61897
|
};
|
|
61898
|
-
return (jsx("div", { className: "fixed inset-0 bg-black
|
|
61898
|
+
return (jsx("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4 admin-modal-overlay", children: jsxs("div", { className: `bg-white rounded-lg w-full ${sizeClasses[size]} flex flex-col overflow-hidden shadow-2xl admin-modal-content`, style: { height: height }, children: [jsx("div", { className: "fixed inset-0 pointer-events-none admin-modal-sidebar-placeholder" }), jsxs("div", { className: "px-6 py-4 border-b", children: [jsx("h3", { className: "text-lg font-semibold", children: title }), subtitle && jsx("p", { className: "text-sm text-gray-500 mt-1", children: subtitle })] }), tabs.length > 1 && (jsx("div", { className: "border-b border-gray-200 bg-white", children: jsx("nav", { className: "-mb-px flex items-center px-6 admin-modal-tabs", "aria-label": "Tabs", children: tabs.map((tab, index) => (jsxs(React__default.Fragment, { children: [jsx("button", { type: "button", onClick: () => onTabChange(tab.id), className: `whitespace-nowrap border-b-2 py-3 px-4 text-sm font-medium transition-colors ${activeTabId === tab.id
|
|
61899
61899
|
? 'border-blue-500 text-blue-600'
|
|
61900
61900
|
: 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'}`, "aria-current": activeTabId === tab.id ? 'page' : undefined, children: tab.label }), index < tabs.length - 1 && (jsx("div", { className: "admin-modal-tab-separator" }))] }, tab.id))) }) })), onSubmit ? (jsx("form", { className: "flex-1 overflow-y-auto min-h-0 h-0 px-6 py-6 admin-modal-form", onSubmit: handleFormSubmit, id: formId, noValidate: true, children: activeTab?.content || children })) : (jsx("div", { className: "flex-1 overflow-y-auto min-h-0 h-0 px-6 py-6 admin-modal-content-area", children: activeTab?.content || children })), jsxs("div", { className: "px-6 py-4 border-t bg-gray-50 flex justify-between gap-3", children: [jsx("button", { type: "button", onClick: onClose, className: "px-4 py-2 text-sm text-gray-600 hover:text-gray-800", disabled: isSaving, children: "Cancel" }), jsxs("div", { className: "flex gap-3", children: [customFooterActions, onSubmit && (jsx("button", { type: "submit", form: formId, disabled: isSaving, className: "px-4 py-2 text-sm bg-primary-600 text-white rounded hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed", children: isSaving ? 'Saving...' : 'Save Changes' }))] })] })] }) }));
|
|
61901
61901
|
}
|
|
@@ -62116,7 +62116,7 @@ function NotificationBar({ notifications, onDismiss }) {
|
|
|
62116
62116
|
}
|
|
62117
62117
|
return (jsx("div", { className: "fixed top-4 right-4 z-50 space-y-3 max-w-md", children: notifications.map((notification) => {
|
|
62118
62118
|
const IconComponent = getNotificationIcon(notification.type);
|
|
62119
|
-
return (jsx("div", { className: `border-2 rounded-xl p-4 backdrop-blur-sm transform transition-all duration-300 ease-in-out animate-slide-in ${notificationStyles[notification.type]}`, children: jsxs("div", { className: "flex items-start space-x-3", children: [jsx("div", { className: `flex-shrink-0 p-1 rounded-full bg-white
|
|
62119
|
+
return (jsx("div", { className: `border-2 rounded-xl p-4 backdrop-blur-sm transform transition-all duration-300 ease-in-out animate-slide-in ${notificationStyles[notification.type]}`, children: jsxs("div", { className: "flex items-start space-x-3", children: [jsx("div", { className: `flex-shrink-0 p-1 rounded-full bg-white/50 ${iconStyles[notification.type]}`, children: jsx(IconComponent, { className: "h-5 w-5" }) }), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("p", { className: "text-sm font-semibold mb-1 leading-tight", children: notification.title }), jsx("p", { className: "text-sm leading-relaxed opacity-90", children: notification.message })] }), notification.dismissible && onDismiss && (jsx("button", { onClick: () => onDismiss(notification.id), className: `flex-shrink-0 p-1.5 hover:bg-white/60 rounded-full transition-all duration-200 ${iconStyles[notification.type]} hover:scale-110`, title: "Dismiss notification", children: jsx(X, { className: "h-4 w-4" }) }))] }) }, notification.id));
|
|
62120
62120
|
}) }));
|
|
62121
62121
|
}
|
|
62122
62122
|
|