@papernote/ui 1.10.15 → 1.10.16

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.js CHANGED
@@ -722,7 +722,7 @@ function usePrefersMobile() {
722
722
  }
723
723
 
724
724
  // Size classes for trigger button
725
- const sizeClasses$a = {
725
+ const sizeClasses$b = {
726
726
  sm: 'h-8 text-sm py-1',
727
727
  md: 'h-10 text-base py-2',
728
728
  lg: 'h-12 text-base py-3 min-h-touch', // 44px touch target
@@ -1039,14 +1039,14 @@ const Select = React.forwardRef((props, ref) => {
1039
1039
  if (useNativeSelect) {
1040
1040
  return (jsxRuntime.jsxs("div", { className: "w-full", children: [label && (jsxRuntime.jsx("label", { id: labelId, className: "label", children: label })), jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsxs("select", { ref: nativeSelectRef, value: value || '', onChange: (e) => onChange?.(e.target.value), disabled: disabled, className: `
1041
1041
  input w-full appearance-none pr-10
1042
- ${sizeClasses$a[effectiveSize]}
1042
+ ${sizeClasses$b[effectiveSize]}
1043
1043
  ${error ? 'border-error-400 focus:border-error-400 focus:ring-error-400' : ''}
1044
1044
  ${disabled ? 'opacity-40 cursor-not-allowed' : 'cursor-pointer'}
1045
1045
  `, "aria-labelledby": label ? labelId : undefined, "aria-invalid": error ? 'true' : undefined, "aria-describedby": error ? errorId : (helperText ? helperTextId : undefined), children: [jsxRuntime.jsx("option", { value: "", disabled: true, children: placeholder }), options.map((opt) => (jsxRuntime.jsx("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))), groups.map((group) => (jsxRuntime.jsx("optgroup", { label: group.label, children: group.options.map((opt) => (jsxRuntime.jsx("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))) }, group.label)))] }), jsxRuntime.jsx(lucideReact.ChevronDown, { className: "absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 text-ink-500 pointer-events-none" })] }), error && (jsxRuntime.jsx("p", { id: errorId, className: "mt-2 text-xs text-error-600", role: "alert", "aria-live": "assertive", children: error })), helperText && !error && (jsxRuntime.jsx("p", { id: helperTextId, className: "mt-2 text-xs text-ink-600", children: helperText }))] }));
1046
1046
  }
1047
1047
  return (jsxRuntime.jsxs("div", { className: "w-full", children: [label && (jsxRuntime.jsx("label", { id: labelId, className: "label", children: label })), jsxRuntime.jsx("div", { ref: selectRef, className: "relative", children: jsxRuntime.jsxs("button", { ref: buttonRef, type: "button", onClick: () => !disabled && setIsOpen(!isOpen), disabled: disabled, className: `
1048
1048
  input w-full flex items-center justify-between px-3
1049
- ${sizeClasses$a[effectiveSize]}
1049
+ ${sizeClasses$b[effectiveSize]}
1050
1050
  ${error ? 'border-error-400 focus:border-error-400 focus:ring-error-400' : ''}
1051
1051
  ${disabled ? 'opacity-40 cursor-not-allowed' : 'cursor-pointer'}
1052
1052
  `, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-controls": listboxId, "aria-labelledby": label ? labelId : undefined, "aria-label": !label ? placeholder : undefined, "aria-activedescendant": activeDescendant, "aria-invalid": error ? 'true' : undefined, "aria-describedby": error ? errorId : (helperText ? helperTextId : undefined), "aria-disabled": disabled, children: [jsxRuntime.jsxs("span", { className: `flex items-center gap-2 ${selectedOption ? 'text-ink-800' : 'text-ink-400'}`, children: [loading && jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin text-ink-500" }), !loading && selectedOption?.icon && jsxRuntime.jsx("span", { children: selectedOption.icon }), selectedOption ? selectedOption.label : placeholder] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [clearable && value && (jsxRuntime.jsx("button", { type: "button", onClick: (e) => {
@@ -1191,7 +1191,7 @@ const Switch = React.forwardRef(({ checked, onChange, label, description, disabl
1191
1191
  Switch.displayName = 'Switch';
1192
1192
 
1193
1193
  // Size classes for textarea
1194
- const sizeClasses$9 = {
1194
+ const sizeClasses$a = {
1195
1195
  sm: 'px-3 py-2 text-sm',
1196
1196
  md: 'px-4 py-3 text-sm',
1197
1197
  lg: 'px-4 py-3.5 text-base', // Larger padding and text for mobile
@@ -1279,7 +1279,7 @@ const Textarea = React.forwardRef(({ label, helperText, validationState, validat
1279
1279
  bg-white bg-subtle-grain transition-all duration-200
1280
1280
  focus:outline-none focus:ring-2 ${getResizeClass()}
1281
1281
  disabled:bg-paper-100 disabled:text-ink-400 disabled:cursor-not-allowed disabled:opacity-60
1282
- ${sizeClasses$9[effectiveSize]}
1282
+ ${sizeClasses$a[effectiveSize]}
1283
1283
  ${getValidationClasses()}
1284
1284
  ${loading ? 'pr-10' : ''}
1285
1285
  ${className}
@@ -4606,7 +4606,7 @@ function BottomSheetActions({ children, className = '' }) {
4606
4606
  return (jsxRuntime.jsx("div", { className: `flex flex-col gap-2 px-4 py-4 border-t border-paper-200 bg-white ${className}`, children: children }));
4607
4607
  }
4608
4608
 
4609
- const sizeClasses$8 = {
4609
+ const sizeClasses$9 = {
4610
4610
  sm: 'max-w-md',
4611
4611
  md: 'max-w-lg',
4612
4612
  lg: 'max-w-2xl',
@@ -4746,7 +4746,7 @@ function Modal({ isOpen, onClose, title, children, size = 'md', showCloseButton
4746
4746
  return reactDom.createPortal(jsxRuntime.jsx(BottomSheet, { isOpen: isOpen, onClose: onClose, title: title, height: mobileHeight, showHandle: mobileShowHandle, showCloseButton: showCloseButton, children: children }), document.body);
4747
4747
  }
4748
4748
  // Render as standard modal on desktop
4749
- 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: {
4749
+ 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$9[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: {
4750
4750
  maxHeight: maxHeight || (scrollable ? 'calc(100vh - 200px)' : undefined),
4751
4751
  }, children: children })] }) }));
4752
4752
  return reactDom.createPortal(modalContent, document.body);
@@ -5809,7 +5809,7 @@ function Alert({ variant = 'info', title, children, onClose, className = '', act
5809
5809
  return (jsxRuntime.jsx("div", { className: `rounded-lg border p-4 ${styles.container} ${className}`, role: "alert", children: jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [jsxRuntime.jsx("div", { className: "flex-shrink-0 mt-0.5", children: styles.icon }), jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [title && jsxRuntime.jsx("h4", { className: "text-sm font-medium mb-1", children: title }), jsxRuntime.jsx("div", { className: "text-sm", children: children }), actions.length > 0 && (jsxRuntime.jsx("div", { className: "flex gap-2 mt-3", children: actions.map((action, index) => (jsxRuntime.jsx("button", { onClick: action.onClick, className: getButtonStyles(action.variant), children: action.label }, index))) }))] }), onClose && (jsxRuntime.jsx("button", { onClick: onClose, className: "flex-shrink-0 text-current opacity-70 hover:opacity-100 transition-opacity", "aria-label": "Close alert", children: jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }) }))] }) }));
5810
5810
  }
5811
5811
 
5812
- const sizeClasses$7 = {
5812
+ const sizeClasses$8 = {
5813
5813
  left: {
5814
5814
  sm: 'w-64',
5815
5815
  md: 'w-96',
@@ -5888,7 +5888,7 @@ function Drawer({ isOpen, onClose, title, children, placement = 'right', size =
5888
5888
  const isHorizontal = placement === 'left' || placement === 'right';
5889
5889
  return (jsxRuntime.jsxs("div", { className: "fixed inset-0 z-50 flex", children: [showOverlay && (jsxRuntime.jsx("div", { className: "fixed inset-0 bg-ink-900 bg-opacity-50 backdrop-blur-sm animate-fade-in", onClick: handleOverlayClick, "aria-hidden": "true" })), jsxRuntime.jsxs("div", { className: `
5890
5890
  fixed ${placementClasses[placement]}
5891
- ${sizeClasses$7[placement][size]}
5891
+ ${sizeClasses$8[placement][size]}
5892
5892
  bg-white border-paper-200 shadow-2xl
5893
5893
  ${isHorizontal ? 'border-r' : 'border-b'}
5894
5894
  ${animationClasses[placement].enter}
@@ -6030,6 +6030,16 @@ function useConfirmDialog() {
6030
6030
  };
6031
6031
  }
6032
6032
 
6033
+ const sizeClasses$7 = {
6034
+ sm: 'h-3.5 w-3.5',
6035
+ md: 'h-4 w-4',
6036
+ lg: 'h-5 w-5',
6037
+ };
6038
+ function HelpTooltip({ content, icon = 'help', size = 'md', position = 'top', className = '', }) {
6039
+ const IconComponent = icon === 'info' ? lucideReact.Info : lucideReact.HelpCircle;
6040
+ return (jsxRuntime.jsx(Tooltip, { content: content, position: position, children: jsxRuntime.jsx("span", { className: `inline-flex items-center justify-center text-ink-400 hover:text-ink-600 cursor-help transition-colors ${className}`, role: "button", "aria-label": "Help", tabIndex: 0, children: jsxRuntime.jsx(IconComponent, { className: sizeClasses$7[size] }) }) }));
6041
+ }
6042
+
6033
6043
  function Popover({ trigger: triggerElement, children, placement = 'bottom', triggerMode = 'click', showArrow = true, offset = 8, open: controlledOpen, onOpenChange, closeOnClickOutside = true, closeOnEscape = true, showDelay = 0, hideDelay = 0, className = '', disabled = false, }) {
6034
6044
  const [internalOpen, setInternalOpen] = React.useState(false);
6035
6045
  const [position, setPosition] = React.useState({ top: 0, left: 0 });
@@ -14723,52 +14733,44 @@ function getAugmentedNamespace(n) {
14723
14733
  * (A1, A1:C5, ...)
14724
14734
  */
14725
14735
 
14726
- var collection;
14727
- var hasRequiredCollection;
14728
-
14729
- function requireCollection () {
14730
- if (hasRequiredCollection) return collection;
14731
- hasRequiredCollection = 1;
14732
- class Collection {
14736
+ let Collection$3 = class Collection {
14733
14737
 
14734
- constructor(data, refs) {
14735
- if (data == null && refs == null) {
14736
- this._data = [];
14737
- this._refs = [];
14738
- } else {
14739
- if (data.length !== refs.length)
14740
- throw Error('Collection: data length should match references length.');
14741
- this._data = data;
14742
- this._refs = refs;
14743
- }
14744
- }
14738
+ constructor(data, refs) {
14739
+ if (data == null && refs == null) {
14740
+ this._data = [];
14741
+ this._refs = [];
14742
+ } else {
14743
+ if (data.length !== refs.length)
14744
+ throw Error('Collection: data length should match references length.');
14745
+ this._data = data;
14746
+ this._refs = refs;
14747
+ }
14748
+ }
14745
14749
 
14746
- get data() {
14747
- return this._data;
14748
- }
14750
+ get data() {
14751
+ return this._data;
14752
+ }
14749
14753
 
14750
- get refs() {
14751
- return this._refs;
14752
- }
14754
+ get refs() {
14755
+ return this._refs;
14756
+ }
14753
14757
 
14754
- get length() {
14755
- return this._data.length;
14756
- }
14758
+ get length() {
14759
+ return this._data.length;
14760
+ }
14757
14761
 
14758
- /**
14759
- * Add data and references to this collection.
14760
- * @param {{}} obj - data
14761
- * @param {{}} ref - reference
14762
- */
14763
- add(obj, ref) {
14764
- this._data.push(obj);
14765
- this._refs.push(ref);
14766
- }
14767
- }
14762
+ /**
14763
+ * Add data and references to this collection.
14764
+ * @param {{}} obj - data
14765
+ * @param {{}} ref - reference
14766
+ */
14767
+ add(obj, ref) {
14768
+ this._data.push(obj);
14769
+ this._refs.push(ref);
14770
+ }
14771
+ };
14768
14772
 
14769
- collection = Collection;
14770
- return collection;
14771
- }
14773
+ var collection = Collection$3;
14772
14774
 
14773
14775
  var helpers;
14774
14776
  var hasRequiredHelpers;
@@ -14777,7 +14779,7 @@ function requireHelpers () {
14777
14779
  if (hasRequiredHelpers) return helpers;
14778
14780
  hasRequiredHelpers = 1;
14779
14781
  const FormulaError = requireError();
14780
- const Collection = requireCollection();
14782
+ const Collection = collection;
14781
14783
 
14782
14784
  const Types = {
14783
14785
  NUMBER: 0,
@@ -24431,7 +24433,7 @@ var engineering = EngineeringFunctions;
24431
24433
 
24432
24434
  const FormulaError$b = requireError();
24433
24435
  const {FormulaHelpers: FormulaHelpers$8, Types: Types$6, WildCard, Address: Address$3} = requireHelpers();
24434
- const Collection$2 = requireCollection();
24436
+ const Collection$2 = collection;
24435
24437
  const H$5 = FormulaHelpers$8;
24436
24438
 
24437
24439
  const ReferenceFunctions$1 = {
@@ -36059,7 +36061,7 @@ var parsing = {
36059
36061
  const FormulaError$4 = requireError();
36060
36062
  const {Address: Address$1} = requireHelpers();
36061
36063
  const {Prefix: Prefix$1, Postfix: Postfix$1, Infix: Infix$1, Operators: Operators$1} = operators;
36062
- const Collection$1 = requireCollection();
36064
+ const Collection$1 = collection;
36063
36065
  const MAX_ROW$1 = 1048576, MAX_COLUMN$1 = 16384;
36064
36066
  const {NotAllInputParsedException} = require$$4;
36065
36067
 
@@ -36821,7 +36823,7 @@ var hooks$1 = {
36821
36823
  const FormulaError$2 = requireError();
36822
36824
  const {FormulaHelpers: FormulaHelpers$1, Types, Address} = requireHelpers();
36823
36825
  const {Prefix, Postfix, Infix, Operators} = operators;
36824
- const Collection = requireCollection();
36826
+ const Collection = collection;
36825
36827
  const MAX_ROW = 1048576, MAX_COLUMN = 16384;
36826
36828
 
36827
36829
  let Utils$1 = class Utils {
@@ -61420,6 +61422,7 @@ exports.FormControl = FormControl;
61420
61422
  exports.FormWizard = FormWizard;
61421
61423
  exports.Grid = Grid;
61422
61424
  exports.GridItem = GridItem;
61425
+ exports.HelpTooltip = HelpTooltip;
61423
61426
  exports.Hide = Hide;
61424
61427
  exports.HorizontalScroll = HorizontalScroll;
61425
61428
  exports.HoverCard = HoverCard;