@papernote/ui 1.11.2 → 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.
package/dist/index.js CHANGED
@@ -12330,16 +12330,18 @@ function FunnelChart({ stages, height = 300, showConversion = true, onStageClick
12330
12330
  return null;
12331
12331
  const maxCount = Math.max(...stages.map(s => s.count), 1);
12332
12332
  const stageHeight = height / stages.length;
12333
- const svgWidth = 400;
12333
+ const svgWidth = 440;
12334
12334
  const padding = 20;
12335
- const funnelWidth = svgWidth - padding * 2 - 160; // Leave room for labels
12335
+ const leftLabelSpace = 40; // Space for conversion rate labels on left
12336
+ const rightLabelSpace = 160; // Space for stage name + value labels on right
12337
+ const funnelWidth = svgWidth - padding * 2 - leftLabelSpace - rightLabelSpace;
12336
12338
  return (jsxRuntime.jsx("div", { className: className, children: jsxRuntime.jsx("svg", { width: "100%", viewBox: `0 0 ${svgWidth} ${height}`, preserveAspectRatio: "xMidYMid meet", children: stages.map((stage, idx) => {
12337
12339
  const ratio = stage.count / maxCount;
12338
12340
  const nextRatio = idx < stages.length - 1 ? stages[idx + 1].count / maxCount : ratio;
12339
12341
  const y = idx * stageHeight;
12340
12342
  const topWidth = funnelWidth * ratio;
12341
12343
  const bottomWidth = funnelWidth * nextRatio;
12342
- const centerX = padding + funnelWidth / 2;
12344
+ const centerX = padding + leftLabelSpace + funnelWidth / 2;
12343
12345
  const color = stage.color || defaultColors[idx % defaultColors.length];
12344
12346
  // Conversion rate
12345
12347
  const conversionRate = idx > 0 && stages[idx - 1].count > 0
@@ -15690,44 +15692,52 @@ function getAugmentedNamespace(n) {
15690
15692
  * (A1, A1:C5, ...)
15691
15693
  */
15692
15694
 
15693
- let Collection$3 = class Collection {
15695
+ var collection;
15696
+ var hasRequiredCollection;
15697
+
15698
+ function requireCollection () {
15699
+ if (hasRequiredCollection) return collection;
15700
+ hasRequiredCollection = 1;
15701
+ class Collection {
15694
15702
 
15695
- constructor(data, refs) {
15696
- if (data == null && refs == null) {
15697
- this._data = [];
15698
- this._refs = [];
15699
- } else {
15700
- if (data.length !== refs.length)
15701
- throw Error('Collection: data length should match references length.');
15702
- this._data = data;
15703
- this._refs = refs;
15704
- }
15705
- }
15703
+ constructor(data, refs) {
15704
+ if (data == null && refs == null) {
15705
+ this._data = [];
15706
+ this._refs = [];
15707
+ } else {
15708
+ if (data.length !== refs.length)
15709
+ throw Error('Collection: data length should match references length.');
15710
+ this._data = data;
15711
+ this._refs = refs;
15712
+ }
15713
+ }
15706
15714
 
15707
- get data() {
15708
- return this._data;
15709
- }
15715
+ get data() {
15716
+ return this._data;
15717
+ }
15710
15718
 
15711
- get refs() {
15712
- return this._refs;
15713
- }
15719
+ get refs() {
15720
+ return this._refs;
15721
+ }
15714
15722
 
15715
- get length() {
15716
- return this._data.length;
15717
- }
15723
+ get length() {
15724
+ return this._data.length;
15725
+ }
15718
15726
 
15719
- /**
15720
- * Add data and references to this collection.
15721
- * @param {{}} obj - data
15722
- * @param {{}} ref - reference
15723
- */
15724
- add(obj, ref) {
15725
- this._data.push(obj);
15726
- this._refs.push(ref);
15727
- }
15728
- };
15727
+ /**
15728
+ * Add data and references to this collection.
15729
+ * @param {{}} obj - data
15730
+ * @param {{}} ref - reference
15731
+ */
15732
+ add(obj, ref) {
15733
+ this._data.push(obj);
15734
+ this._refs.push(ref);
15735
+ }
15736
+ }
15729
15737
 
15730
- var collection = Collection$3;
15738
+ collection = Collection;
15739
+ return collection;
15740
+ }
15731
15741
 
15732
15742
  var helpers;
15733
15743
  var hasRequiredHelpers;
@@ -15736,7 +15746,7 @@ function requireHelpers () {
15736
15746
  if (hasRequiredHelpers) return helpers;
15737
15747
  hasRequiredHelpers = 1;
15738
15748
  const FormulaError = requireError();
15739
- const Collection = collection;
15749
+ const Collection = requireCollection();
15740
15750
 
15741
15751
  const Types = {
15742
15752
  NUMBER: 0,
@@ -25390,7 +25400,7 @@ var engineering = EngineeringFunctions;
25390
25400
 
25391
25401
  const FormulaError$b = requireError();
25392
25402
  const {FormulaHelpers: FormulaHelpers$8, Types: Types$6, WildCard, Address: Address$3} = requireHelpers();
25393
- const Collection$2 = collection;
25403
+ const Collection$2 = requireCollection();
25394
25404
  const H$5 = FormulaHelpers$8;
25395
25405
 
25396
25406
  const ReferenceFunctions$1 = {
@@ -37018,7 +37028,7 @@ var parsing = {
37018
37028
  const FormulaError$4 = requireError();
37019
37029
  const {Address: Address$1} = requireHelpers();
37020
37030
  const {Prefix: Prefix$1, Postfix: Postfix$1, Infix: Infix$1, Operators: Operators$1} = operators;
37021
- const Collection$1 = collection;
37031
+ const Collection$1 = requireCollection();
37022
37032
  const MAX_ROW$1 = 1048576, MAX_COLUMN$1 = 16384;
37023
37033
  const {NotAllInputParsedException} = require$$4;
37024
37034
 
@@ -37780,7 +37790,7 @@ var hooks$1 = {
37780
37790
  const FormulaError$2 = requireError();
37781
37791
  const {FormulaHelpers: FormulaHelpers$1, Types, Address} = requireHelpers();
37782
37792
  const {Prefix, Postfix, Infix, Operators} = operators;
37783
- const Collection = collection;
37793
+ const Collection = requireCollection();
37784
37794
  const MAX_ROW = 1048576, MAX_COLUMN = 16384;
37785
37795
 
37786
37796
  let Utils$1 = class Utils {