@vantageos/mosaic-blocks 0.4.0-alpha → 0.4.2-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.2-alpha";
50
50
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
51
51
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
52
52
  }
@@ -10024,7 +10024,9 @@ function MosaicDataTable({
10024
10024
  emptyState,
10025
10025
  emptyMessage,
10026
10026
  className,
10027
- ref
10027
+ ref,
10028
+ footerSlot,
10029
+ pagination
10028
10030
  }) {
10029
10031
  const [sort, setSort] = React27.useState(null);
10030
10032
  function handleHeaderClick(col) {
@@ -10137,7 +10139,36 @@ function MosaicDataTable({
10137
10139
  },
10138
10140
  key
10139
10141
  );
10140
- }) })
10142
+ }) }),
10143
+ (footerSlot || pagination) && /* @__PURE__ */ jsxRuntime.jsx("tfoot", { "data-slot": "data-table-footer", children: /* @__PURE__ */ jsxRuntime.jsx("tr", { "data-slot": "data-table-footer-row", children: /* @__PURE__ */ jsxRuntime.jsxs(
10144
+ "td",
10145
+ {
10146
+ "data-slot": "data-table-footer-cell",
10147
+ colSpan: columns.length,
10148
+ className: "px-4 py-3 text-center",
10149
+ children: [
10150
+ footerSlot,
10151
+ pagination && /* @__PURE__ */ jsxRuntime.jsx(
10152
+ "div",
10153
+ {
10154
+ "data-slot": "data-table-pagination",
10155
+ "aria-live": "polite",
10156
+ className: "flex items-center justify-center",
10157
+ children: pagination.isLoadingMore ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: pagination.loadingLabel }) : pagination.hasMore && /* @__PURE__ */ jsxRuntime.jsx(
10158
+ "button",
10159
+ {
10160
+ type: "button",
10161
+ "data-slot": "data-table-load-more",
10162
+ onClick: pagination.onLoadMore,
10163
+ className: "rounded-md border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
10164
+ children: pagination.loadMoreLabel
10165
+ }
10166
+ )
10167
+ }
10168
+ )
10169
+ ]
10170
+ }
10171
+ ) }) })
10141
10172
  ]
10142
10173
  }
10143
10174
  );
@@ -10219,6 +10250,21 @@ var stepDescriptionVariants = classVarianceAuthority.cva(["text-xs transition-co
10219
10250
  status: "upcoming"
10220
10251
  }
10221
10252
  });
10253
+ var stepSegmentBarVariants = classVarianceAuthority.cva(["flex w-full items-center gap-1"], {
10254
+ variants: {},
10255
+ defaultVariants: {}
10256
+ });
10257
+ var stepSegmentVariants = classVarianceAuthority.cva(["h-1.5 flex-1 min-w-2 rounded-full transition-colors"], {
10258
+ variants: {
10259
+ filled: {
10260
+ true: "bg-foreground",
10261
+ false: "bg-muted"
10262
+ }
10263
+ },
10264
+ defaultVariants: {
10265
+ filled: false
10266
+ }
10267
+ });
10222
10268
  function cn67(...classes) {
10223
10269
  return classes.filter(Boolean).join(" ");
10224
10270
  }
@@ -10228,7 +10274,60 @@ function resolveStatus(step, index, currentIndex) {
10228
10274
  if (index === currentIndex) return "current";
10229
10275
  return "upcoming";
10230
10276
  }
10231
- function MosaicStepPipeline({
10277
+ function MosaicStepPipeline(props) {
10278
+ if (props.variant === "segments") {
10279
+ return /* @__PURE__ */ jsxRuntime.jsx(MosaicStepPipelineSegments, { ...props });
10280
+ }
10281
+ return /* @__PURE__ */ jsxRuntime.jsx(MosaicStepPipelineDots, { ...props });
10282
+ }
10283
+ MosaicStepPipeline.displayName = "MosaicStepPipeline";
10284
+ function MosaicStepPipelineSegments({
10285
+ steps,
10286
+ currentIndex = 0,
10287
+ className,
10288
+ progressAriaLabel,
10289
+ progressLabel,
10290
+ ref
10291
+ }) {
10292
+ const total = steps.length;
10293
+ const current = steps.reduce((count, step, index) => {
10294
+ const status = resolveStatus(step, index, currentIndex);
10295
+ return status === "upcoming" ? count : count + 1;
10296
+ }, 0);
10297
+ return /* @__PURE__ */ jsxRuntime.jsx(
10298
+ "div",
10299
+ {
10300
+ ref,
10301
+ "data-slot": "step-segment-bar",
10302
+ role: "progressbar",
10303
+ tabIndex: -1,
10304
+ "aria-label": progressAriaLabel,
10305
+ "aria-valuemin": 0,
10306
+ "aria-valuemax": total,
10307
+ "aria-valuenow": current,
10308
+ "aria-valuetext": progressLabel ? progressLabel(current, total) : void 0,
10309
+ className: cn67(stepSegmentBarVariants(), className),
10310
+ children: steps.map((step, index) => {
10311
+ const status = resolveStatus(step, index, currentIndex);
10312
+ const filled = status !== "upcoming";
10313
+ const key = step.id !== void 0 ? step.id : index;
10314
+ return /* @__PURE__ */ jsxRuntime.jsx(
10315
+ "div",
10316
+ {
10317
+ "data-slot": "step-segment",
10318
+ "data-status": status,
10319
+ "data-filled": filled,
10320
+ "aria-hidden": "true",
10321
+ className: cn67(stepSegmentVariants({ filled }))
10322
+ },
10323
+ key
10324
+ );
10325
+ })
10326
+ }
10327
+ );
10328
+ }
10329
+ MosaicStepPipelineSegments.displayName = "MosaicStepPipelineSegments";
10330
+ function MosaicStepPipelineDots({
10232
10331
  steps,
10233
10332
  currentIndex = 0,
10234
10333
  orientation = "horizontal",
@@ -10343,7 +10442,7 @@ function MosaicStepPipeline({
10343
10442
  }
10344
10443
  );
10345
10444
  }
10346
- MosaicStepPipeline.displayName = "MosaicStepPipeline";
10445
+ MosaicStepPipelineDots.displayName = "MosaicStepPipelineDots";
10347
10446
  function cn68(...classes) {
10348
10447
  return classes.filter(Boolean).join(" ");
10349
10448
  }