@cntyclub/ui-react 0.7.0 → 0.7.1
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.d.ts +6 -10
- package/dist/index.js +25 -43
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/pipeline.tsx +31 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cntyclub/ui-react",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "React component library for the Country Club UI Kit — Base UI primitives styled with the Country Club design system (Tailwind CSS v4)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { ChevronRightIcon } from "lucide-react";
|
|
4
|
-
import { Fragment } from "react";
|
|
5
3
|
import type * as React from "react";
|
|
6
4
|
|
|
7
5
|
import { cn } from "../../lib/utils/css";
|
|
@@ -19,69 +17,46 @@ interface PipelineProps extends React.ComponentProps<"div"> {
|
|
|
19
17
|
/** Ordered funnel stages, left to right. */
|
|
20
18
|
stages: PipelineStage[];
|
|
21
19
|
/**
|
|
22
|
-
* Conversion markers shown
|
|
23
|
-
*
|
|
20
|
+
* Conversion markers shown after each stage (length = `stages.length - 1`).
|
|
21
|
+
* Typically a percentage string; any node works.
|
|
24
22
|
*/
|
|
25
23
|
conversions?: React.ReactNode[];
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
/**
|
|
29
|
-
* A horizontal conversion funnel — a row of headline stages with the
|
|
30
|
-
* step-to-step conversion
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* it lays out as a horizontal funnel when it has room and stacks vertically
|
|
34
|
-
* when narrow (e.g. beside a docked panel). When stacked, each conversion sits
|
|
35
|
-
* attached to the stage number it converts from; when wide, it sits between
|
|
36
|
-
* the two stages with a chevron.
|
|
27
|
+
* A horizontal conversion funnel — a row of headline stages, each with the
|
|
28
|
+
* step-to-step conversion pill sitting right beside its number. The row wraps
|
|
29
|
+
* onto multiple lines when space is tight (e.g. beside a docked panel), so it
|
|
30
|
+
* stays readable without stretching the stages apart.
|
|
37
31
|
*/
|
|
38
32
|
function Pipeline({ stages, conversions = [], className, ...props }: PipelineProps) {
|
|
39
33
|
return (
|
|
40
|
-
<div
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
<div
|
|
35
|
+
className={cn("flex flex-wrap items-start gap-x-5 gap-y-4", className)}
|
|
36
|
+
data-slot="pipeline"
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
{stages.map((stage, i) => {
|
|
40
|
+
const conv = i < stages.length - 1 ? conversions[i] : undefined;
|
|
41
|
+
return (
|
|
42
|
+
<div key={i} data-slot="pipeline-stage">
|
|
43
|
+
<div className="flex items-baseline gap-2">
|
|
44
|
+
<span
|
|
45
|
+
className={cn(
|
|
46
|
+
"font-sans font-semibold text-3xl text-foreground leading-none tabular-nums tracking-tight",
|
|
47
|
+
stage.accent && "text-primary",
|
|
48
|
+
)}
|
|
49
49
|
>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<PipelineConversion className="@min-[640px]:hidden">
|
|
61
|
-
{conv}
|
|
62
|
-
</PipelineConversion>
|
|
63
|
-
) : null}
|
|
64
|
-
</div>
|
|
65
|
-
<div className="mt-1 text-muted-foreground text-xs leading-snug">
|
|
66
|
-
{stage.label}
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
{conv != null ? (
|
|
70
|
-
<div
|
|
71
|
-
className="hidden flex-col items-center justify-center gap-1 self-center px-1 @min-[640px]:flex"
|
|
72
|
-
data-slot="pipeline-connector"
|
|
73
|
-
>
|
|
74
|
-
<PipelineConversion>{conv}</PipelineConversion>
|
|
75
|
-
<ChevronRightIcon
|
|
76
|
-
className="size-3.5 text-muted-foreground/50"
|
|
77
|
-
strokeWidth={2}
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
) : null}
|
|
81
|
-
</Fragment>
|
|
82
|
-
);
|
|
83
|
-
})}
|
|
84
|
-
</div>
|
|
50
|
+
{stage.value}
|
|
51
|
+
</span>
|
|
52
|
+
{conv != null ? <PipelineConversion>{conv}</PipelineConversion> : null}
|
|
53
|
+
</div>
|
|
54
|
+
<div className="mt-1.5 text-muted-foreground text-xs leading-snug">
|
|
55
|
+
{stage.label}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
})}
|
|
85
60
|
</div>
|
|
86
61
|
);
|
|
87
62
|
}
|