@papernote/ui 1.11.1 → 1.11.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.
@@ -1 +1 @@
1
- {"version":3,"file":"FunnelChart.d.ts","sourceRoot":"","sources":["../../src/components/FunnelChart.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gCAAgC;IAChC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoBD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,MAAY,EACZ,cAAqB,EACrB,YAAY,EACZ,SAAc,GACf,EAAE,gBAAgB,kDAoGlB"}
1
+ {"version":3,"file":"FunnelChart.d.ts","sourceRoot":"","sources":["../../src/components/FunnelChart.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gCAAgC;IAChC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoBD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,MAAY,EACZ,cAAqB,EACrB,YAAY,EACZ,SAAc,GACf,EAAE,gBAAgB,kDAsGlB"}
package/dist/index.esm.js CHANGED
@@ -11523,7 +11523,7 @@ function TabsTrigger({ children, value, disabled = false, icon, badge, badgeVari
11523
11523
  ${disabled ? 'opacity-40 cursor-not-allowed' : 'cursor-pointer'}
11524
11524
  focus:outline-none focus-visible:ring-2 focus-visible:ring-accent-500 focus-visible:ring-offset-1
11525
11525
  ${className}
11526
- `, "data-testid": dataAttributes?.['data-testid'] || `tab-${value}`, ...dataAttributes, children: [icon && jsx("span", { className: `flex-shrink-0 ${sizeClasses[size].icon}`, children: icon }), jsx("span", { children: children }), badge !== undefined && (jsx(Badge, { variant: badgeVariant, size: sizeClasses[size].badgeSize, children: badge }))] }));
11526
+ `, "data-testid": dataAttributes?.['data-testid'] || `tab-${value}`, ...dataAttributes, children: [icon && jsx("span", { className: `flex-shrink-0 [&>svg]:h-full [&>svg]:w-full ${sizeClasses[size].icon}`, children: icon }), jsx("span", { children: children }), badge !== undefined && (jsx(Badge, { variant: badgeVariant, size: sizeClasses[size].badgeSize, children: badge }))] }));
11527
11527
  }
11528
11528
  /**
11529
11529
  * TabsContent - Content panel for a tab
@@ -11752,7 +11752,7 @@ function Tabs({ tabs, activeTab: controlledActiveTab, defaultTab, variant = 'und
11752
11752
  ${tab.disabled ? 'opacity-40 cursor-not-allowed' : 'cursor-pointer'}
11753
11753
  focus:outline-none focus-visible:ring-2 focus-visible:ring-accent-500 focus-visible:ring-offset-1
11754
11754
  group
11755
- `, "data-testid": tab.dataAttributes?.['data-testid'] || `tab-${tab.id}`, ...tab.dataAttributes, children: [tab.icon && jsx("span", { className: `flex-shrink-0 ${sizeClasses[size].icon}`, children: tab.icon }), jsx("span", { className: isTabCloseable ? 'mr-1' : '', children: tab.label }), tab.badge !== undefined && (jsx(Badge, { variant: tab.badgeVariant || 'info', size: sizeClasses[size].badgeSize, children: tab.badge })), isTabCloseable && onClose && (jsx("span", { role: "button", "aria-label": `Close ${tab.label}`, onClick: (e) => handleClose(e, tab.id), className: `
11755
+ `, "data-testid": tab.dataAttributes?.['data-testid'] || `tab-${tab.id}`, ...tab.dataAttributes, children: [tab.icon && jsx("span", { className: `flex-shrink-0 [&>svg]:h-full [&>svg]:w-full ${sizeClasses[size].icon}`, children: tab.icon }), jsx("span", { className: isTabCloseable ? 'mr-1' : '', children: tab.label }), tab.badge !== undefined && (jsx(Badge, { variant: tab.badgeVariant || 'info', size: sizeClasses[size].badgeSize, children: tab.badge })), isTabCloseable && onClose && (jsx("span", { role: "button", "aria-label": `Close ${tab.label}`, onClick: (e) => handleClose(e, tab.id), className: `
11756
11756
  flex-shrink-0 p-0.5 rounded
11757
11757
  text-ink-400 hover:text-ink-700 hover:bg-paper-200
11758
11758
  opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100
@@ -12310,16 +12310,18 @@ function FunnelChart({ stages, height = 300, showConversion = true, onStageClick
12310
12310
  return null;
12311
12311
  const maxCount = Math.max(...stages.map(s => s.count), 1);
12312
12312
  const stageHeight = height / stages.length;
12313
- const svgWidth = 400;
12313
+ const svgWidth = 440;
12314
12314
  const padding = 20;
12315
- const funnelWidth = svgWidth - padding * 2 - 160; // Leave room for labels
12315
+ const leftLabelSpace = 40; // Space for conversion rate labels on left
12316
+ const rightLabelSpace = 160; // Space for stage name + value labels on right
12317
+ const funnelWidth = svgWidth - padding * 2 - leftLabelSpace - rightLabelSpace;
12316
12318
  return (jsx("div", { className: className, children: jsx("svg", { width: "100%", viewBox: `0 0 ${svgWidth} ${height}`, preserveAspectRatio: "xMidYMid meet", children: stages.map((stage, idx) => {
12317
12319
  const ratio = stage.count / maxCount;
12318
12320
  const nextRatio = idx < stages.length - 1 ? stages[idx + 1].count / maxCount : ratio;
12319
12321
  const y = idx * stageHeight;
12320
12322
  const topWidth = funnelWidth * ratio;
12321
12323
  const bottomWidth = funnelWidth * nextRatio;
12322
- const centerX = padding + funnelWidth / 2;
12324
+ const centerX = padding + leftLabelSpace + funnelWidth / 2;
12323
12325
  const color = stage.color || defaultColors[idx % defaultColors.length];
12324
12326
  // Conversion rate
12325
12327
  const conversionRate = idx > 0 && stages[idx - 1].count > 0
@@ -15670,44 +15672,52 @@ function getAugmentedNamespace(n) {
15670
15672
  * (A1, A1:C5, ...)
15671
15673
  */
15672
15674
 
15673
- let Collection$3 = class Collection {
15675
+ var collection;
15676
+ var hasRequiredCollection;
15677
+
15678
+ function requireCollection () {
15679
+ if (hasRequiredCollection) return collection;
15680
+ hasRequiredCollection = 1;
15681
+ class Collection {
15674
15682
 
15675
- constructor(data, refs) {
15676
- if (data == null && refs == null) {
15677
- this._data = [];
15678
- this._refs = [];
15679
- } else {
15680
- if (data.length !== refs.length)
15681
- throw Error('Collection: data length should match references length.');
15682
- this._data = data;
15683
- this._refs = refs;
15684
- }
15685
- }
15683
+ constructor(data, refs) {
15684
+ if (data == null && refs == null) {
15685
+ this._data = [];
15686
+ this._refs = [];
15687
+ } else {
15688
+ if (data.length !== refs.length)
15689
+ throw Error('Collection: data length should match references length.');
15690
+ this._data = data;
15691
+ this._refs = refs;
15692
+ }
15693
+ }
15686
15694
 
15687
- get data() {
15688
- return this._data;
15689
- }
15695
+ get data() {
15696
+ return this._data;
15697
+ }
15690
15698
 
15691
- get refs() {
15692
- return this._refs;
15693
- }
15699
+ get refs() {
15700
+ return this._refs;
15701
+ }
15694
15702
 
15695
- get length() {
15696
- return this._data.length;
15697
- }
15703
+ get length() {
15704
+ return this._data.length;
15705
+ }
15698
15706
 
15699
- /**
15700
- * Add data and references to this collection.
15701
- * @param {{}} obj - data
15702
- * @param {{}} ref - reference
15703
- */
15704
- add(obj, ref) {
15705
- this._data.push(obj);
15706
- this._refs.push(ref);
15707
- }
15708
- };
15707
+ /**
15708
+ * Add data and references to this collection.
15709
+ * @param {{}} obj - data
15710
+ * @param {{}} ref - reference
15711
+ */
15712
+ add(obj, ref) {
15713
+ this._data.push(obj);
15714
+ this._refs.push(ref);
15715
+ }
15716
+ }
15709
15717
 
15710
- var collection = Collection$3;
15718
+ collection = Collection;
15719
+ return collection;
15720
+ }
15711
15721
 
15712
15722
  var helpers;
15713
15723
  var hasRequiredHelpers;
@@ -15716,7 +15726,7 @@ function requireHelpers () {
15716
15726
  if (hasRequiredHelpers) return helpers;
15717
15727
  hasRequiredHelpers = 1;
15718
15728
  const FormulaError = requireError();
15719
- const Collection = collection;
15729
+ const Collection = requireCollection();
15720
15730
 
15721
15731
  const Types = {
15722
15732
  NUMBER: 0,
@@ -25370,7 +25380,7 @@ var engineering = EngineeringFunctions;
25370
25380
 
25371
25381
  const FormulaError$b = requireError();
25372
25382
  const {FormulaHelpers: FormulaHelpers$8, Types: Types$6, WildCard, Address: Address$3} = requireHelpers();
25373
- const Collection$2 = collection;
25383
+ const Collection$2 = requireCollection();
25374
25384
  const H$5 = FormulaHelpers$8;
25375
25385
 
25376
25386
  const ReferenceFunctions$1 = {
@@ -36998,7 +37008,7 @@ var parsing = {
36998
37008
  const FormulaError$4 = requireError();
36999
37009
  const {Address: Address$1} = requireHelpers();
37000
37010
  const {Prefix: Prefix$1, Postfix: Postfix$1, Infix: Infix$1, Operators: Operators$1} = operators;
37001
- const Collection$1 = collection;
37011
+ const Collection$1 = requireCollection();
37002
37012
  const MAX_ROW$1 = 1048576, MAX_COLUMN$1 = 16384;
37003
37013
  const {NotAllInputParsedException} = require$$4;
37004
37014
 
@@ -37760,7 +37770,7 @@ var hooks$1 = {
37760
37770
  const FormulaError$2 = requireError();
37761
37771
  const {FormulaHelpers: FormulaHelpers$1, Types, Address} = requireHelpers();
37762
37772
  const {Prefix, Postfix, Infix, Operators} = operators;
37763
- const Collection = collection;
37773
+ const Collection = requireCollection();
37764
37774
  const MAX_ROW = 1048576, MAX_COLUMN = 16384;
37765
37775
 
37766
37776
  let Utils$1 = class Utils {