@fairmint/ui 0.2.32 → 0.2.33

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.
@@ -15,6 +15,11 @@ export interface EquityRibbonChartProps {
15
15
  hideLabels?: boolean;
16
16
  /** Canvas behind ribbons. @default 'transparent' */
17
17
  background?: RibbonBackground;
18
+ /**
19
+ * Color of the 2px seam between ribbons (SVG stroke).
20
+ * Defaults to the `background` surface; when `background` is `transparent`, defaults to `ribbonChartSurface.black`.
21
+ */
22
+ gapColor?: string;
18
23
  /** `hero` = wide marketing chart; `mark` = tight fill for square icon. @default 'hero' */
19
24
  layout?: RibbonLayout;
20
25
  /** Label text color (CSS color). @default ribbonChartLabelDefault */
@@ -23,8 +28,14 @@ export interface EquityRibbonChartProps {
23
28
  className?: string;
24
29
  /** Override chart height (CSS length). */
25
30
  height?: string;
31
+ /**
32
+ * Chart width in pixels (sets root `width`, same idea as `height`).
33
+ * Clamped up to the rendered height when needed; wider charts increase right-edge stagger between ribbons.
34
+ * Omit to fill the parent (`width: 100%`).
35
+ */
36
+ chartWidth?: number;
26
37
  /** Passed to root for layout wrappers. */
27
38
  style?: CSSProperties;
28
39
  }
29
- export declare function EquityRibbonChart({ labels, bandCount: bandCountProp, gradients, animated, hideLabels, background, layout, labelColor, className, height, style, }: EquityRibbonChartProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare function EquityRibbonChart({ labels, bandCount: bandCountProp, gradients, animated, hideLabels, background, gapColor, layout, labelColor, className, height, chartWidth, style, }: EquityRibbonChartProps): import("react/jsx-runtime").JSX.Element;
30
41
  //# sourceMappingURL=EquityRibbonChart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EquityRibbonChart.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/EquityRibbonChart/EquityRibbonChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAOnB,MAAM,OAAO,CAAC;AACf,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAQL,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAGxB,MAAM,eAAe,CAAC;AAUvB,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,mEAAmE;IACnE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,SAAS,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC1C,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,0FAA0F;IAC1F,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AA8BD,wBAAgB,iBAAiB,CAAC,EAChC,MAA8B,EAC9B,SAAS,EAAE,aAAiB,EAC5B,SAAS,EACT,QAAe,EACf,UAAkB,EAClB,UAA0B,EAC1B,MAAe,EACf,UAAoC,EACpC,SAAS,EACT,MAAM,EACN,KAAK,GACN,EAAE,sBAAsB,2CAsQxB"}
1
+ {"version":3,"file":"EquityRibbonChart.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/EquityRibbonChart/EquityRibbonChart.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAOnB,MAAM,OAAO,CAAC;AACf,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAWL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. @default 'black' */
12
12
  background?: RibbonBackground;
13
+ /** Seam color between ribbons; use `transparent` to hide strokes on transparent backgrounds. */
14
+ gapColor?: EquityRibbonChartProps["gapColor"];
13
15
  /** Label text color when labels are shown. @default ribbonChartLabelDefault */
14
16
  labelColor?: EquityRibbonChartProps["labelColor"];
15
17
  /** Additional class name. */
@@ -19,5 +21,5 @@ export interface FairmintRibbonMarkProps {
19
21
  /**
20
22
  * Square brand mark — stacked ribbons without labels (favicon / app icon source).
21
23
  */
22
- export declare function FairmintRibbonMark({ size, bandCount, gradients, background, labelColor, className, style, }: FairmintRibbonMarkProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function FairmintRibbonMark({ size, bandCount, gradients, background, gapColor, labelColor, className, style, }: FairmintRibbonMarkProps): import("react/jsx-runtime").JSX.Element;
23
25
  //# sourceMappingURL=FairmintRibbonMark.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FairmintRibbonMark.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/EquityRibbonChart/FairmintRibbonMark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,SAAS,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAChD,sCAAsC;IACtC,SAAS,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAChD,8CAA8C;IAC9C,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,sBAAsB,CAAC,YAAY,CAAC,CAAC;IAClD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAS,EACT,SAAa,EACb,SAAS,EACT,UAAoB,EACpB,UAAU,EACV,SAAS,EACT,KAAK,GACN,EAAE,uBAAuB,2CAiBzB"}
1
+ {"version":3,"file":"FairmintRibbonMark.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/EquityRibbonChart/FairmintRibbonMark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,SAAS,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAChD,sCAAsC;IACtC,SAAS,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAChD,8CAA8C;IAC9C,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAC9C,+EAA+E;IAC/E,UAAU,CAAC,EAAE,sBAAsB,CAAC,YAAY,CAAC,CAAC;IAClD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAS,EACT,SAAa,EACb,SAAS,EACT,UAAoB,EACpB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,KAAK,GACN,EAAE,uBAAuB,2CAkBzB"}
@@ -17,8 +17,13 @@ export interface RibbonGeometryConfig {
17
17
  samples: number;
18
18
  }
19
19
  export declare const DEFAULT_RIBBON_CONFIG: RibbonGeometryConfig;
20
- /** Right edge for mark: all ribbons clip here (vertical line on the right). */
20
+ /** Right edge for mark / square charts: all ribbons align on this vertical line. */
21
21
  export declare const MARK_RIBBON_RIGHT_EDGE = 0.936;
22
+ /**
23
+ * Stagger scale: `int_px = (chartWidth - height) * RIBBON_END_STAGGER_X` when chartWidth > height.
24
+ * Calibrated at W=1000, H=500: int_px = 0.009 × 1000 ⇒ X = 9 / 500 = 0.018.
25
+ */
26
+ export declare const RIBBON_END_STAGGER_X: number;
22
27
  /**
23
28
  * Horizontal scale factor for mark fit (mark layout only).
24
29
  * < 1 compresses width so the stack reads square in a 1:1 viewport.
@@ -46,6 +51,19 @@ export interface RibbonGeometryResult {
46
51
  bandCount: number;
47
52
  }
48
53
  export declare function clampBandCount(count: number, max?: number): number;
54
+ /**
55
+ * Geometry width for paths/viewBox.
56
+ * With `chartWidth`: at least rendered height, then respect a narrower measured width (e.g. `max-width: 100%`).
57
+ * Without `chartWidth`: use measured container width only.
58
+ */
59
+ export declare function resolveChartGeometryWidth(containerWidth: number, containerHeight: number, chartWidth?: number): number;
60
+ /** CSS cap for explicit `chartWidth` (never below rendered height). */
61
+ export declare function nominalChartWidthPx(chartWidth: number, renderedHeightPx: number): number;
62
+ /** Normalized gap between adjacent ribbon right edges (0 when square). */
63
+ export declare function ribbonEndStaggerNorm(chartWidth: number, height: number): number;
64
+ /** Per-band clip right edge (bottom band leftmost, top band at `rightAnchor`). */
65
+ export declare function buildStaggeredEndDraw(bandCount: number, chartWidth: number, height: number): readonly number[];
66
+ export declare function configWithChartDimensions(base: RibbonGeometryConfig, chartWidth: number, height: number): RibbonGeometryConfig;
49
67
  export declare function buildRibbonGeometry(width: number, height: number, labels: readonly string[], config?: RibbonGeometryConfig, bandCount?: number, layout?: RibbonLayout): RibbonGeometryResult | null;
50
68
  /** Quadratic ease-in-out (GSAP `power2.inOut` equivalent) for reveal motion. */
51
69
  export declare function easePower1InOut(t: number): number;
@@ -1 +1 @@
1
- {"version":3,"file":"ribbonGeometry.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/EquityRibbonChart/ribbonGeometry.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,EAAE,oBAsBnC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,EAAE,oBAahC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAwB3C,sFAAsF;AACtF,wBAAgB,cAAc,CAC5B,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT,MAAM,CAMR;AA2BD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,oBAAoB,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAqFD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,MAAM,CAG7D;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,MAAM,GAAE,oBAA4C,EACpD,SAAS,GAAE,MAA6B,EACxC,MAAM,GAAE,YAAqB,GAC5B,oBAAoB,GAAG,IAAI,CAoD7B;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAGjD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,gFAAgF;AAChF,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,oBAA4C,GACnD,MAAM,CAER"}
1
+ {"version":3,"file":"ribbonGeometry.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/EquityRibbonChart/ribbonGeometry.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,MAAM,EAA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C,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,gFAAgF;AAChF,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,oBAA4C,GACnD,MAAM,CAER"}
@@ -45040,6 +45040,8 @@ const DEFAULT_RIBBON_CONFIG = {
45040
45040
  samples: 72
45041
45041
  };
45042
45042
  const MARK_RIBBON_RIGHT_EDGE = 0.936;
45043
+ const HERO_WIDE_TOP_END = DEFAULT_RIBBON_CONFIG.xEndDraw[DEFAULT_RIBBON_CONFIG.xEndDraw.length - 1];
45044
+ const RIBBON_END_STAGGER_X = DEFAULT_RIBBON_CONFIG.xEndStagger * 1e3 / (1e3 - 500);
45043
45045
  const MARK_FIT_HORIZONTAL_COMPRESS = 0.78;
45044
45046
  const MARK_RIBBON_CONFIG = {
45045
45047
  ...DEFAULT_RIBBON_CONFIG,
@@ -45158,6 +45160,45 @@ function clampBandCount(count2, max2 = 5) {
45158
45160
  if (!Number.isFinite(count2)) return max2;
45159
45161
  return Math.min(max2, Math.max(1, Math.round(count2)));
45160
45162
  }
45163
+ function resolveChartGeometryWidth(containerWidth, containerHeight, chartWidth) {
45164
+ const layoutWidth = Number.isFinite(containerWidth) && containerWidth > 0 ? containerWidth : 0;
45165
+ const layoutHeight = Number.isFinite(containerHeight) && containerHeight > 0 ? containerHeight : 0;
45166
+ if (chartWidth != null && Number.isFinite(chartWidth) && chartWidth > 0) {
45167
+ const nominal = Math.max(chartWidth, layoutHeight);
45168
+ if (layoutWidth > 0) {
45169
+ return Math.min(nominal, layoutWidth);
45170
+ }
45171
+ return nominal;
45172
+ }
45173
+ if (layoutWidth > 0) {
45174
+ return layoutWidth;
45175
+ }
45176
+ return layoutHeight;
45177
+ }
45178
+ function nominalChartWidthPx(chartWidth, renderedHeightPx) {
45179
+ const heightPx = Number.isFinite(renderedHeightPx) && renderedHeightPx > 0 ? renderedHeightPx : 0;
45180
+ return Math.max(chartWidth, heightPx);
45181
+ }
45182
+ function ribbonEndStaggerNorm(chartWidth, height) {
45183
+ const w = Math.max(chartWidth, height);
45184
+ if (w <= height) return 0;
45185
+ const intPx = (w - height) * RIBBON_END_STAGGER_X;
45186
+ return intPx / w;
45187
+ }
45188
+ function buildStaggeredEndDraw(bandCount, chartWidth, height) {
45189
+ const validBandCount = clampBandCount(bandCount);
45190
+ const intNorm = ribbonEndStaggerNorm(chartWidth, height);
45191
+ const t = DEFAULT_RIBBON_CONFIG.xEndStagger > 0 ? Math.min(1, intNorm / DEFAULT_RIBBON_CONFIG.xEndStagger) : 0;
45192
+ const rightAnchor = MARK_RIBBON_RIGHT_EDGE - t * (MARK_RIBBON_RIGHT_EDGE - HERO_WIDE_TOP_END);
45193
+ const last = validBandCount - 1;
45194
+ return Array.from({ length: validBandCount }, (_, i) => rightAnchor - (last - i) * intNorm);
45195
+ }
45196
+ function configWithChartDimensions(base, chartWidth, height) {
45197
+ return {
45198
+ ...base,
45199
+ xEndDraw: buildStaggeredEndDraw(base.xStart.length, chartWidth, height)
45200
+ };
45201
+ }
45161
45202
  function buildRibbonGeometry(width, height, labels, config2 = DEFAULT_RIBBON_CONFIG, bandCount = config2.xStart.length, layout = "hero") {
45162
45203
  const totalBands = config2.xStart.length;
45163
45204
  const visibleBands = clampBandCount(bandCount, totalBands);
@@ -45271,10 +45312,12 @@ function EquityRibbonChart({
45271
45312
  animated = true,
45272
45313
  hideLabels = false,
45273
45314
  background = "transparent",
45315
+ gapColor,
45274
45316
  layout = "hero",
45275
45317
  labelColor = ribbonChartLabelDefault,
45276
45318
  className,
45277
45319
  height,
45320
+ chartWidth,
45278
45321
  style
45279
45322
  }) {
45280
45323
  const bandCount = clampBandCount(bandCountProp);
@@ -45304,11 +45347,13 @@ function EquityRibbonChart({
45304
45347
  cancelRevealAnimation();
45305
45348
  const el = rootRef.current;
45306
45349
  if (!el) return;
45307
- const width = el.clientWidth;
45350
+ const containerWidth = el.clientWidth;
45308
45351
  const heightPx = el.clientHeight;
45309
- const config2 = layout === "mark" ? MARK_RIBBON_CONFIG : void 0;
45352
+ const geometryWidth = resolveChartGeometryWidth(containerWidth, heightPx, chartWidth);
45353
+ const baseConfig = layout === "mark" ? MARK_RIBBON_CONFIG : DEFAULT_RIBBON_CONFIG;
45354
+ const config2 = configWithChartDimensions(baseConfig, geometryWidth, heightPx);
45310
45355
  const built = buildRibbonGeometry(
45311
- width,
45356
+ geometryWidth,
45312
45357
  heightPx,
45313
45358
  labelsRef.current,
45314
45359
  config2,
@@ -45325,7 +45370,7 @@ function EquityRibbonChart({
45325
45370
  }))
45326
45371
  );
45327
45372
  }
45328
- }, [animated, bandCount, cancelRevealAnimation, labelsKey, layout]);
45373
+ }, [animated, bandCount, cancelRevealAnimation, chartWidth, labelsKey, layout]);
45329
45374
  React.useLayoutEffect(() => {
45330
45375
  playedRef.current = false;
45331
45376
  revealScheduleRef.current = 0;
@@ -45432,17 +45477,23 @@ function EquityRibbonChart({
45432
45477
  }, [geometry, runReveal]);
45433
45478
  const suppressLabels = hideLabels || layout === "mark";
45434
45479
  const activeGeometry = geometry && geometry.bandCount === bandCount ? geometry : null;
45480
+ const hasExplicitWidth = chartWidth != null && Number.isFinite(chartWidth) && chartWidth > 0;
45435
45481
  const rootClass = [
45436
45482
  "fairmint-equity-ribbon",
45437
45483
  RIBBON_BACKGROUND_CLASS[background],
45438
45484
  layout === "mark" ? "fairmint-equity-ribbon--layout-mark" : "",
45485
+ hasExplicitWidth ? "fairmint-equity-ribbon--has-chart-width" : "",
45439
45486
  suppressLabels ? "fairmint-equity-ribbon--hidden-labels" : "",
45440
45487
  className ?? ""
45441
45488
  ].filter(Boolean).join(" ");
45489
+ const resolvedGapColor = gapColor ?? (background === "white" ? ribbonChartSurface.white : background === "black" ? ribbonChartSurface.black : ribbonChartSurface.black);
45490
+ const nominalWidthPx = hasExplicitWidth && chartWidth ? nominalChartWidthPx(chartWidth, activeGeometry?.height ?? 0) : null;
45442
45491
  const rootStyle = {
45443
45492
  ...RIBBON_SURFACE_CSS_VARS,
45493
+ "--fairmint-ribbon-gap-color": resolvedGapColor,
45444
45494
  ...style,
45445
- ...height ? { height } : {}
45495
+ ...height ? { height } : {},
45496
+ ...nominalWidthPx != null ? { "--fairmint-ribbon-nominal-width": `${nominalWidthPx}px` } : {}
45446
45497
  };
45447
45498
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: rootClass, style: rootStyle, children: [
45448
45499
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -45515,6 +45566,7 @@ function FairmintRibbonMark({
45515
45566
  bandCount = 5,
45516
45567
  gradients,
45517
45568
  background = "black",
45569
+ gapColor,
45518
45570
  labelColor,
45519
45571
  className,
45520
45572
  style
@@ -45526,6 +45578,7 @@ function FairmintRibbonMark({
45526
45578
  bandCount,
45527
45579
  gradients,
45528
45580
  background,
45581
+ gapColor,
45529
45582
  labelColor,
45530
45583
  layout: "mark",
45531
45584
  animated: false,