@cytario/design 3.1.2 → 3.2.0
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 +4 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -773,11 +773,14 @@ declare function Pill({ children, color, className, ...rest }: PillProps): react
|
|
|
773
773
|
|
|
774
774
|
interface PathPillProps {
|
|
775
775
|
children: string;
|
|
776
|
+
/** Number of trailing segments to show; earlier ones collapse to dots. Defaults to all. */
|
|
776
777
|
visibleCount?: number;
|
|
778
|
+
/** Override per-segment color. Falls back to hash-based `pillColorFromName`. */
|
|
779
|
+
colorFn?: (segment: string, index: number) => PillColor;
|
|
777
780
|
className?: string;
|
|
778
781
|
}
|
|
779
782
|
/** Renders a slash-separated path as overlapping, hash-colored pill segments. */
|
|
780
|
-
declare function PathPill({ children, visibleCount, className, }: PathPillProps): react_jsx_runtime.JSX.Element | null;
|
|
783
|
+
declare function PathPill({ children, visibleCount, colorFn, className, }: PathPillProps): react_jsx_runtime.JSX.Element | null;
|
|
781
784
|
|
|
782
785
|
interface FormWizardContextValue {
|
|
783
786
|
/** Zero-based index of the currently active step */
|
package/dist/index.js
CHANGED
|
@@ -614,7 +614,7 @@ function Select({
|
|
|
614
614
|
sizeStyles[size]
|
|
615
615
|
),
|
|
616
616
|
children: ({ isSelected }) => /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
617
|
-
/* @__PURE__ */ jsx7("span", { className: "truncate", children: renderItem ? renderItem(item) : item.name }),
|
|
617
|
+
/* @__PURE__ */ jsx7("span", { className: renderItem ? "min-w-0 flex-1" : "truncate", children: renderItem ? renderItem(item) : item.name }),
|
|
618
618
|
isSelected && /* @__PURE__ */ jsx7(Check, { className: "h-4 w-4 shrink-0 text-(--color-action-primary)" })
|
|
619
619
|
] })
|
|
620
620
|
}
|
|
@@ -3147,12 +3147,14 @@ import { twMerge as twMerge19 } from "tailwind-merge";
|
|
|
3147
3147
|
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3148
3148
|
function PathPill({
|
|
3149
3149
|
children,
|
|
3150
|
-
visibleCount
|
|
3150
|
+
visibleCount,
|
|
3151
|
+
colorFn,
|
|
3151
3152
|
className
|
|
3152
3153
|
}) {
|
|
3153
3154
|
const segments = children.split("/").filter(Boolean);
|
|
3154
3155
|
if (segments.length === 0) return null;
|
|
3155
|
-
const
|
|
3156
|
+
const effectiveVisible = visibleCount ?? segments.length;
|
|
3157
|
+
const dotCount = Math.max(0, segments.length - effectiveVisible);
|
|
3156
3158
|
const fullPath = segments.join(" / ");
|
|
3157
3159
|
return /* @__PURE__ */ jsx47(
|
|
3158
3160
|
"div",
|
|
@@ -3163,7 +3165,7 @@ function PathPill({
|
|
|
3163
3165
|
const isCollapsed = i < dotCount;
|
|
3164
3166
|
const isLast = i === segments.length - 1;
|
|
3165
3167
|
const cx = twMerge19(!isLast && "pr-5 -mr-4", isCollapsed && "pr-3");
|
|
3166
|
-
const color = pillColorFromName(segment);
|
|
3168
|
+
const color = colorFn ? colorFn(segment, i) : pillColorFromName(segment);
|
|
3167
3169
|
return /* @__PURE__ */ jsx47(
|
|
3168
3170
|
Pill,
|
|
3169
3171
|
{
|