@j3m-quantum/ui 2.1.7 → 2.1.8

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/README.md CHANGED
@@ -280,7 +280,7 @@ import '@j3m-quantum/ui/styles'
280
280
  Button, ButtonGroup, Input, InputGroup, Textarea, Checkbox, RadioGroup, Switch, Slider, Select, NativeSelect, Toggle, ToggleGroup, Form, Field, Label, CopyButton
281
281
 
282
282
  ### Display
283
- Card, Table, Badge, Avatar, UserAvatarsDropdown, Separator, Skeleton, Accordion, Tabs, Calendar, EventCalendar, Carousel, Chart, AspectRatio, Empty, Item, Kbd
283
+ Card, Table, Badge, Pill, Avatar, UserAvatarsDropdown, Separator, Skeleton, Accordion, Tabs, Calendar, EventCalendar, Carousel, Chart, AspectRatio, Empty, Item, Kbd
284
284
 
285
285
  ### Feedback
286
286
  Alert, AlertDialog, Progress, CircularProgress, Tooltip, Sonner (Toast), Spinner
package/dist/cli/index.js CHANGED
@@ -456,6 +456,7 @@ var REGISTRY = {
456
456
  { name: "Card", description: "Content container", import: "Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter", figmaNames: ["Card", "Container", "Panel"] },
457
457
  { name: "Table", description: "Data table", import: "Table, TableHeader, TableBody, TableRow, TableHead, TableCell", figmaNames: ["Table", "Data Grid"] },
458
458
  { name: "Badge", description: "Status badge/tag", import: "Badge", figmaNames: ["Badge", "Tag", "Label"] },
459
+ { name: "Pill", description: "Feature-rich pill with status, delta, avatars", import: "Pill, PillStatus, PillDelta, PillAvatar, PillAvatarGroup, PillIcon, PillClose", figmaNames: ["Pill", "Tag", "Chip"] },
459
460
  { name: "Avatar", description: "User avatar", import: "Avatar, AvatarImage, AvatarFallback", figmaNames: ["Avatar", "Profile Image"] },
460
461
  { name: "UserAvatarsDropdown", description: "Avatar with dropdown", import: "UserAvatarsDropdown" },
461
462
  { name: "Separator", description: "Visual divider", import: "Separator" },
package/dist/index.cjs CHANGED
@@ -1992,10 +1992,10 @@ var badgeVariants = classVarianceAuthority.cva(
1992
1992
  {
1993
1993
  variants: {
1994
1994
  variant: {
1995
- default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
1996
- secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
1997
- destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
1998
- outline: "bg-background text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
1995
+ default: "border-transparent bg-primary text-primary-foreground shadow-sm [a&]:hover:bg-primary/90",
1996
+ secondary: "border-transparent bg-secondary text-secondary-foreground shadow-sm [a&]:hover:bg-secondary/90",
1997
+ destructive: "border-transparent bg-destructive text-white shadow-sm [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
1998
+ outline: "bg-background text-foreground shadow-sm [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
1999
1999
  }
2000
2000
  },
2001
2001
  defaultVariants: {
@@ -2064,6 +2064,142 @@ function AvatarFallback({
2064
2064
  }
2065
2065
  );
2066
2066
  }
2067
+ var pillVariants = classVarianceAuthority.cva(
2068
+ "inline-flex items-center justify-center rounded-full border px-2.5 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 gap-1.5 transition-colors overflow-hidden",
2069
+ {
2070
+ variants: {
2071
+ variant: {
2072
+ default: "border-transparent bg-primary text-primary-foreground shadow-sm",
2073
+ secondary: "border-transparent bg-secondary text-secondary-foreground shadow-sm",
2074
+ destructive: "border-transparent bg-destructive text-white shadow-sm dark:bg-destructive/80",
2075
+ outline: "border-border bg-background text-foreground shadow-sm",
2076
+ success: "border-transparent bg-green-500/15 text-green-700 shadow-sm dark:bg-green-500/20 dark:text-green-400",
2077
+ warning: "border-transparent bg-amber-500/15 text-amber-700 shadow-sm dark:bg-amber-500/20 dark:text-amber-400",
2078
+ info: "border-transparent bg-blue-500/15 text-blue-700 shadow-sm dark:bg-blue-500/20 dark:text-blue-400",
2079
+ error: "border-transparent bg-red-500/15 text-red-700 shadow-sm dark:bg-red-500/20 dark:text-red-400"
2080
+ }
2081
+ },
2082
+ defaultVariants: {
2083
+ variant: "default"
2084
+ }
2085
+ }
2086
+ );
2087
+ var statusVariants = classVarianceAuthority.cva(
2088
+ "size-2 rounded-full shrink-0",
2089
+ {
2090
+ variants: {
2091
+ status: {
2092
+ success: "bg-green-500",
2093
+ warning: "bg-amber-500",
2094
+ error: "bg-red-500",
2095
+ info: "bg-blue-500",
2096
+ neutral: "bg-gray-400"
2097
+ },
2098
+ pulse: {
2099
+ true: "animate-pulse",
2100
+ false: ""
2101
+ }
2102
+ },
2103
+ defaultVariants: {
2104
+ status: "neutral",
2105
+ pulse: false
2106
+ }
2107
+ }
2108
+ );
2109
+ function PillStatus({ status = "neutral", pulse = false }) {
2110
+ return /* @__PURE__ */ jsxRuntime.jsx(
2111
+ "span",
2112
+ {
2113
+ "data-slot": "pill-status",
2114
+ className: cn(statusVariants({ status, pulse }))
2115
+ }
2116
+ );
2117
+ }
2118
+ function PillDelta({ type, children, showIcon = true }) {
2119
+ const Icon2 = type === "increase" ? lucideReact.TrendingUp : type === "decrease" ? lucideReact.TrendingDown : lucideReact.Minus;
2120
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2121
+ "span",
2122
+ {
2123
+ "data-slot": "pill-delta",
2124
+ className: cn(
2125
+ "inline-flex items-center gap-1",
2126
+ type === "increase" && "text-green-600 dark:text-green-400",
2127
+ type === "decrease" && "text-red-600 dark:text-red-400",
2128
+ type === "neutral" && "text-muted-foreground"
2129
+ ),
2130
+ children: [
2131
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-3" }),
2132
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children })
2133
+ ]
2134
+ }
2135
+ );
2136
+ }
2137
+ function PillAvatar({ src, fallback, alt }) {
2138
+ return /* @__PURE__ */ jsxRuntime.jsxs(Avatar, { className: "size-5 -ml-1", "data-slot": "pill-avatar", children: [
2139
+ src && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src, alt: alt || fallback }),
2140
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "text-[10px] font-medium", children: fallback.slice(0, 2).toUpperCase() })
2141
+ ] });
2142
+ }
2143
+ function PillAvatarGroup({ avatars, max = 3 }) {
2144
+ const visibleAvatars = avatars.slice(0, max);
2145
+ const remainingCount = avatars.length - max;
2146
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex -space-x-2 -ml-1", "data-slot": "pill-avatar-group", children: [
2147
+ visibleAvatars.map((avatar, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2148
+ Avatar,
2149
+ {
2150
+ className: "size-5 border-2 border-background",
2151
+ children: [
2152
+ avatar.src && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: avatar.src, alt: avatar.alt || avatar.fallback }),
2153
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "text-[10px] font-medium", children: avatar.fallback.slice(0, 2).toUpperCase() })
2154
+ ]
2155
+ },
2156
+ index
2157
+ )),
2158
+ remainingCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(Avatar, { className: "size-5 border-2 border-background", children: /* @__PURE__ */ jsxRuntime.jsxs(AvatarFallback, { className: "text-[10px] font-medium bg-muted", children: [
2159
+ "+",
2160
+ remainingCount
2161
+ ] }) })
2162
+ ] });
2163
+ }
2164
+ function PillIcon({ children }) {
2165
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-slot": "pill-icon", className: "[&>svg]:size-3.5 shrink-0", children });
2166
+ }
2167
+ function PillClose({ onClick }) {
2168
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2169
+ "button",
2170
+ {
2171
+ type: "button",
2172
+ "data-slot": "pill-close",
2173
+ onClick: (e) => {
2174
+ e.stopPropagation();
2175
+ onClick?.(e);
2176
+ },
2177
+ className: "ml-0.5 -mr-1 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10 transition-colors focus:outline-none focus:ring-1 focus:ring-ring",
2178
+ children: [
2179
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3" }),
2180
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Remove" })
2181
+ ]
2182
+ }
2183
+ );
2184
+ }
2185
+ function Pill({
2186
+ className,
2187
+ variant,
2188
+ asChild = false,
2189
+ children,
2190
+ ...props
2191
+ }) {
2192
+ const Comp = asChild ? reactSlot.Slot : "span";
2193
+ return /* @__PURE__ */ jsxRuntime.jsx(
2194
+ Comp,
2195
+ {
2196
+ "data-slot": "pill",
2197
+ className: cn(pillVariants({ variant }), className),
2198
+ ...props,
2199
+ children
2200
+ }
2201
+ );
2202
+ }
2067
2203
  function DropdownMenu({
2068
2204
  ...props
2069
2205
  }) {
@@ -19281,6 +19417,13 @@ exports.PaginationLink = PaginationLink;
19281
19417
  exports.PaginationNext = PaginationNext;
19282
19418
  exports.PaginationPrevious = PaginationPrevious;
19283
19419
  exports.PhaseGantt = PhaseGantt;
19420
+ exports.Pill = Pill;
19421
+ exports.PillAvatar = PillAvatar;
19422
+ exports.PillAvatarGroup = PillAvatarGroup;
19423
+ exports.PillClose = PillClose;
19424
+ exports.PillDelta = PillDelta;
19425
+ exports.PillIcon = PillIcon;
19426
+ exports.PillStatus = PillStatus;
19284
19427
  exports.PlanningTable = PlanningTable;
19285
19428
  exports.PlanningTableToolbar = PlanningTableToolbar;
19286
19429
  exports.PlanningWeekCommentPopover = PlanningWeekCommentPopover;
@@ -19477,6 +19620,7 @@ exports.isMultiDayEvent = isMultiDayEvent;
19477
19620
  exports.isWorkingHour = isWorkingHour;
19478
19621
  exports.navigateDate = navigateDate;
19479
19622
  exports.navigationMenuTriggerStyle = navigationMenuTriggerStyle;
19623
+ exports.pillVariants = pillVariants;
19480
19624
  exports.playerCanvasPlayButtonVariants = playerCanvasPlayButtonVariants;
19481
19625
  exports.playerCanvasSkipButtonVariants = playerCanvasSkipButtonVariants;
19482
19626
  exports.rangeText = rangeText;