@vantageos/mosaic-blocks 0.4.0-alpha → 0.4.1-alpha

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.cjs CHANGED
@@ -46,7 +46,7 @@ function _interopNamespace(e) {
46
46
  var React27__namespace = /*#__PURE__*/_interopNamespace(React27);
47
47
 
48
48
  // src/version.ts
49
- var version = "0.4.0-alpha";
49
+ var version = "0.4.1-alpha";
50
50
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
51
51
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
52
52
  }
@@ -10219,6 +10219,21 @@ var stepDescriptionVariants = classVarianceAuthority.cva(["text-xs transition-co
10219
10219
  status: "upcoming"
10220
10220
  }
10221
10221
  });
10222
+ var stepSegmentBarVariants = classVarianceAuthority.cva(["flex w-full items-center gap-1"], {
10223
+ variants: {},
10224
+ defaultVariants: {}
10225
+ });
10226
+ var stepSegmentVariants = classVarianceAuthority.cva(["h-1.5 flex-1 min-w-2 rounded-full transition-colors"], {
10227
+ variants: {
10228
+ filled: {
10229
+ true: "bg-foreground",
10230
+ false: "bg-muted"
10231
+ }
10232
+ },
10233
+ defaultVariants: {
10234
+ filled: false
10235
+ }
10236
+ });
10222
10237
  function cn67(...classes) {
10223
10238
  return classes.filter(Boolean).join(" ");
10224
10239
  }
@@ -10228,7 +10243,60 @@ function resolveStatus(step, index, currentIndex) {
10228
10243
  if (index === currentIndex) return "current";
10229
10244
  return "upcoming";
10230
10245
  }
10231
- function MosaicStepPipeline({
10246
+ function MosaicStepPipeline(props) {
10247
+ if (props.variant === "segments") {
10248
+ return /* @__PURE__ */ jsxRuntime.jsx(MosaicStepPipelineSegments, { ...props });
10249
+ }
10250
+ return /* @__PURE__ */ jsxRuntime.jsx(MosaicStepPipelineDots, { ...props });
10251
+ }
10252
+ MosaicStepPipeline.displayName = "MosaicStepPipeline";
10253
+ function MosaicStepPipelineSegments({
10254
+ steps,
10255
+ currentIndex = 0,
10256
+ className,
10257
+ progressAriaLabel,
10258
+ progressLabel,
10259
+ ref
10260
+ }) {
10261
+ const total = steps.length;
10262
+ const current = steps.reduce((count, step, index) => {
10263
+ const status = resolveStatus(step, index, currentIndex);
10264
+ return status === "upcoming" ? count : count + 1;
10265
+ }, 0);
10266
+ return /* @__PURE__ */ jsxRuntime.jsx(
10267
+ "div",
10268
+ {
10269
+ ref,
10270
+ "data-slot": "step-segment-bar",
10271
+ role: "progressbar",
10272
+ tabIndex: -1,
10273
+ "aria-label": progressAriaLabel,
10274
+ "aria-valuemin": 0,
10275
+ "aria-valuemax": total,
10276
+ "aria-valuenow": current,
10277
+ "aria-valuetext": progressLabel ? progressLabel(current, total) : void 0,
10278
+ className: cn67(stepSegmentBarVariants(), className),
10279
+ children: steps.map((step, index) => {
10280
+ const status = resolveStatus(step, index, currentIndex);
10281
+ const filled = status !== "upcoming";
10282
+ const key = step.id !== void 0 ? step.id : index;
10283
+ return /* @__PURE__ */ jsxRuntime.jsx(
10284
+ "div",
10285
+ {
10286
+ "data-slot": "step-segment",
10287
+ "data-status": status,
10288
+ "data-filled": filled,
10289
+ "aria-hidden": "true",
10290
+ className: cn67(stepSegmentVariants({ filled }))
10291
+ },
10292
+ key
10293
+ );
10294
+ })
10295
+ }
10296
+ );
10297
+ }
10298
+ MosaicStepPipelineSegments.displayName = "MosaicStepPipelineSegments";
10299
+ function MosaicStepPipelineDots({
10232
10300
  steps,
10233
10301
  currentIndex = 0,
10234
10302
  orientation = "horizontal",
@@ -10343,7 +10411,7 @@ function MosaicStepPipeline({
10343
10411
  }
10344
10412
  );
10345
10413
  }
10346
- MosaicStepPipeline.displayName = "MosaicStepPipeline";
10414
+ MosaicStepPipelineDots.displayName = "MosaicStepPipelineDots";
10347
10415
  function cn68(...classes) {
10348
10416
  return classes.filter(Boolean).join(" ");
10349
10417
  }