@j3m-quantum/ui 2.1.7 → 2.1.9

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
@@ -408,11 +408,14 @@ const navItems: NavItem[] = [
408
408
 
409
409
  ## Map Components
410
410
 
411
- Leaflet-based map components for displaying interactive maps. **Requires optional peer dependencies.**
411
+ Leaflet-based map components for displaying interactive maps. **Separate entry point - requires additional dependencies.**
412
+
413
+ > **Note:** Map components are in a separate entry point (`@j3m-quantum/ui/map`) to avoid requiring leaflet for users who don't need maps.
412
414
 
413
415
  ### Installation
414
416
 
415
417
  ```bash
418
+ # Install map dependencies
416
419
  npm install leaflet react-leaflet
417
420
  ```
418
421
 
@@ -425,13 +428,14 @@ Import Leaflet CSS in your app's entry CSS file:
425
428
  @import "tailwindcss";
426
429
  @import "tw-animate-css";
427
430
  @import "@j3m-quantum/ui/styles";
428
- @import "leaflet/dist/leaflet.css";
431
+ @import "leaflet/dist/leaflet.css"; /* Required for maps */
429
432
  ```
430
433
 
431
434
  ### Basic Usage
432
435
 
433
436
  ```tsx
434
- import { Map, MapTileLayer, MapMarker, MapPopup } from '@j3m-quantum/ui'
437
+ // Import from the /map entry point
438
+ import { Map, MapTileLayer, MapMarker, MapPopup } from '@j3m-quantum/ui/map'
435
439
 
436
440
  function MyMap() {
437
441
  return (
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" },
@@ -534,14 +535,14 @@ var REGISTRY = {
534
535
  ]
535
536
  },
536
537
  map: {
537
- label: "Map (requires leaflet)",
538
+ label: "Map (separate import: @j3m-quantum/ui/map)",
538
539
  components: [
539
- { name: "Map", description: "Map container", import: "Map" },
540
- { name: "MapTileLayer", description: "Map tile layer", import: "MapTileLayer" },
541
- { name: "MapMarker", description: "Map marker", import: "MapMarker" },
542
- { name: "MapPopup", description: "Marker popup", import: "MapPopup" },
543
- { name: "MapTooltip", description: "Marker tooltip", import: "MapTooltip" },
544
- { name: "MapZoomControl", description: "Zoom controls", import: "MapZoomControl" }
540
+ { name: "Map", description: "Map container", import: "Map from '@j3m-quantum/ui/map'" },
541
+ { name: "MapTileLayer", description: "Map tile layer", import: "MapTileLayer from '@j3m-quantum/ui/map'" },
542
+ { name: "MapMarker", description: "Map marker", import: "MapMarker from '@j3m-quantum/ui/map'" },
543
+ { name: "MapPopup", description: "Marker popup", import: "MapPopup from '@j3m-quantum/ui/map'" },
544
+ { name: "MapTooltip", description: "Marker tooltip", import: "MapTooltip from '@j3m-quantum/ui/map'" },
545
+ { name: "MapZoomControl", description: "Zoom controls", import: "MapZoomControl from '@j3m-quantum/ui/map'" }
545
546
  ]
546
547
  }
547
548
  };
package/dist/index.cjs CHANGED
@@ -40,7 +40,6 @@ var PopoverPrimitive = require('@radix-ui/react-popover');
40
40
  var HoverCardPrimitive = require('@radix-ui/react-hover-card');
41
41
  var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
42
42
  var ResizablePrimitive = require('react-resizable-panels');
43
- var reactLeaflet = require('react-leaflet');
44
43
  var reactTable = require('@tanstack/react-table');
45
44
  var dateFns = require('date-fns');
46
45
  var core = require('@dnd-kit/core');
@@ -1992,10 +1991,10 @@ var badgeVariants = classVarianceAuthority.cva(
1992
1991
  {
1993
1992
  variants: {
1994
1993
  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"
1994
+ default: "border-transparent bg-primary text-primary-foreground shadow-sm [a&]:hover:bg-primary/90",
1995
+ secondary: "border-transparent bg-secondary text-secondary-foreground shadow-sm [a&]:hover:bg-secondary/90",
1996
+ 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",
1997
+ outline: "bg-background text-foreground shadow-sm [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
1999
1998
  }
2000
1999
  },
2001
2000
  defaultVariants: {
@@ -2064,6 +2063,142 @@ function AvatarFallback({
2064
2063
  }
2065
2064
  );
2066
2065
  }
2066
+ var pillVariants = classVarianceAuthority.cva(
2067
+ "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",
2068
+ {
2069
+ variants: {
2070
+ variant: {
2071
+ default: "border-transparent bg-primary text-primary-foreground shadow-sm",
2072
+ secondary: "border-transparent bg-secondary text-secondary-foreground shadow-sm",
2073
+ destructive: "border-transparent bg-destructive text-white shadow-sm dark:bg-destructive/80",
2074
+ outline: "border-border bg-background text-foreground shadow-sm",
2075
+ success: "border-transparent bg-green-500/15 text-green-700 shadow-sm dark:bg-green-500/20 dark:text-green-400",
2076
+ warning: "border-transparent bg-amber-500/15 text-amber-700 shadow-sm dark:bg-amber-500/20 dark:text-amber-400",
2077
+ info: "border-transparent bg-blue-500/15 text-blue-700 shadow-sm dark:bg-blue-500/20 dark:text-blue-400",
2078
+ error: "border-transparent bg-red-500/15 text-red-700 shadow-sm dark:bg-red-500/20 dark:text-red-400"
2079
+ }
2080
+ },
2081
+ defaultVariants: {
2082
+ variant: "default"
2083
+ }
2084
+ }
2085
+ );
2086
+ var statusVariants = classVarianceAuthority.cva(
2087
+ "size-2 rounded-full shrink-0",
2088
+ {
2089
+ variants: {
2090
+ status: {
2091
+ success: "bg-green-500",
2092
+ warning: "bg-amber-500",
2093
+ error: "bg-red-500",
2094
+ info: "bg-blue-500",
2095
+ neutral: "bg-gray-400"
2096
+ },
2097
+ pulse: {
2098
+ true: "animate-pulse",
2099
+ false: ""
2100
+ }
2101
+ },
2102
+ defaultVariants: {
2103
+ status: "neutral",
2104
+ pulse: false
2105
+ }
2106
+ }
2107
+ );
2108
+ function PillStatus({ status = "neutral", pulse = false }) {
2109
+ return /* @__PURE__ */ jsxRuntime.jsx(
2110
+ "span",
2111
+ {
2112
+ "data-slot": "pill-status",
2113
+ className: cn(statusVariants({ status, pulse }))
2114
+ }
2115
+ );
2116
+ }
2117
+ function PillDelta({ type, children, showIcon = true }) {
2118
+ const Icon2 = type === "increase" ? lucideReact.TrendingUp : type === "decrease" ? lucideReact.TrendingDown : lucideReact.Minus;
2119
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2120
+ "span",
2121
+ {
2122
+ "data-slot": "pill-delta",
2123
+ className: cn(
2124
+ "inline-flex items-center gap-1",
2125
+ type === "increase" && "text-green-600 dark:text-green-400",
2126
+ type === "decrease" && "text-red-600 dark:text-red-400",
2127
+ type === "neutral" && "text-muted-foreground"
2128
+ ),
2129
+ children: [
2130
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-3" }),
2131
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children })
2132
+ ]
2133
+ }
2134
+ );
2135
+ }
2136
+ function PillAvatar({ src, fallback, alt }) {
2137
+ return /* @__PURE__ */ jsxRuntime.jsxs(Avatar, { className: "size-5 -ml-1", "data-slot": "pill-avatar", children: [
2138
+ src && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src, alt: alt || fallback }),
2139
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "text-[10px] font-medium", children: fallback.slice(0, 2).toUpperCase() })
2140
+ ] });
2141
+ }
2142
+ function PillAvatarGroup({ avatars, max = 3 }) {
2143
+ const visibleAvatars = avatars.slice(0, max);
2144
+ const remainingCount = avatars.length - max;
2145
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex -space-x-2 -ml-1", "data-slot": "pill-avatar-group", children: [
2146
+ visibleAvatars.map((avatar, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2147
+ Avatar,
2148
+ {
2149
+ className: "size-5 border-2 border-background",
2150
+ children: [
2151
+ avatar.src && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: avatar.src, alt: avatar.alt || avatar.fallback }),
2152
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "text-[10px] font-medium", children: avatar.fallback.slice(0, 2).toUpperCase() })
2153
+ ]
2154
+ },
2155
+ index
2156
+ )),
2157
+ 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: [
2158
+ "+",
2159
+ remainingCount
2160
+ ] }) })
2161
+ ] });
2162
+ }
2163
+ function PillIcon({ children }) {
2164
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-slot": "pill-icon", className: "[&>svg]:size-3.5 shrink-0", children });
2165
+ }
2166
+ function PillClose({ onClick }) {
2167
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2168
+ "button",
2169
+ {
2170
+ type: "button",
2171
+ "data-slot": "pill-close",
2172
+ onClick: (e) => {
2173
+ e.stopPropagation();
2174
+ onClick?.(e);
2175
+ },
2176
+ 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",
2177
+ children: [
2178
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3" }),
2179
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Remove" })
2180
+ ]
2181
+ }
2182
+ );
2183
+ }
2184
+ function Pill({
2185
+ className,
2186
+ variant,
2187
+ asChild = false,
2188
+ children,
2189
+ ...props
2190
+ }) {
2191
+ const Comp = asChild ? reactSlot.Slot : "span";
2192
+ return /* @__PURE__ */ jsxRuntime.jsx(
2193
+ Comp,
2194
+ {
2195
+ "data-slot": "pill",
2196
+ className: cn(pillVariants({ variant }), className),
2197
+ ...props,
2198
+ children
2199
+ }
2200
+ );
2201
+ }
2067
2202
  function DropdownMenu({
2068
2203
  ...props
2069
2204
  }) {
@@ -6245,89 +6380,6 @@ var SectionFooter = React30__namespace.forwardRef(
6245
6380
  )
6246
6381
  );
6247
6382
  SectionFooter.displayName = "SectionFooter";
6248
- function Map2({
6249
- center,
6250
- zoom = 13,
6251
- className,
6252
- children,
6253
- ...props
6254
- }) {
6255
- return /* @__PURE__ */ jsxRuntime.jsx(
6256
- reactLeaflet.MapContainer,
6257
- {
6258
- center,
6259
- zoom,
6260
- className: cn(
6261
- "w-full rounded-lg border border-border overflow-hidden",
6262
- "[&_.leaflet-control-zoom]:border-border",
6263
- "[&_.leaflet-control-zoom]:rounded-md",
6264
- "[&_.leaflet-control-zoom]:shadow-sm",
6265
- "[&_.leaflet-control-zoom-in]:rounded-t-md",
6266
- "[&_.leaflet-control-zoom-in]:border-b",
6267
- "[&_.leaflet-control-zoom-in]:border-border",
6268
- "[&_.leaflet-control-zoom-out]:rounded-b-md",
6269
- "[&_.leaflet-popup-content-wrapper]:rounded-lg",
6270
- "[&_.leaflet-popup-content-wrapper]:shadow-lg",
6271
- "[&_.leaflet-popup-content-wrapper]:border",
6272
- "[&_.leaflet-popup-content-wrapper]:border-border",
6273
- className
6274
- ),
6275
- scrollWheelZoom: true,
6276
- ...props,
6277
- children
6278
- }
6279
- );
6280
- }
6281
- var TILE_LAYERS = {
6282
- default: {
6283
- url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
6284
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
6285
- },
6286
- dark: {
6287
- url: "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",
6288
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>'
6289
- },
6290
- satellite: {
6291
- url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
6292
- attribution: "&copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
6293
- }
6294
- };
6295
- function MapTileLayer({
6296
- variant = "default",
6297
- ...props
6298
- }) {
6299
- const layer = TILE_LAYERS[variant];
6300
- return /* @__PURE__ */ jsxRuntime.jsx(
6301
- reactLeaflet.TileLayer,
6302
- {
6303
- url: layer.url,
6304
- attribution: layer.attribution,
6305
- ...props
6306
- }
6307
- );
6308
- }
6309
- function MapMarker({
6310
- position,
6311
- children,
6312
- ...props
6313
- }) {
6314
- return /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.Marker, { position, ...props, children });
6315
- }
6316
- function MapPopup({
6317
- children,
6318
- ...props
6319
- }) {
6320
- return /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.Popup, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", children }) });
6321
- }
6322
- function MapTooltip({
6323
- children,
6324
- ...props
6325
- }) {
6326
- return /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.Tooltip, { ...props, children });
6327
- }
6328
- function MapZoomControl(props) {
6329
- return /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.ZoomControl, { ...props });
6330
- }
6331
6383
  function DataTableColumnHeader({
6332
6384
  column,
6333
6385
  title,
@@ -19232,12 +19284,6 @@ exports.KanbanProvider = KanbanProvider;
19232
19284
  exports.Kbd = Kbd;
19233
19285
  exports.KbdGroup = KbdGroup;
19234
19286
  exports.Label = Label2;
19235
- exports.Map = Map2;
19236
- exports.MapMarker = MapMarker;
19237
- exports.MapPopup = MapPopup;
19238
- exports.MapTileLayer = MapTileLayer;
19239
- exports.MapTooltip = MapTooltip;
19240
- exports.MapZoomControl = MapZoomControl;
19241
19287
  exports.Menubar = Menubar;
19242
19288
  exports.MenubarCheckboxItem = MenubarCheckboxItem;
19243
19289
  exports.MenubarContent = MenubarContent;
@@ -19281,6 +19327,13 @@ exports.PaginationLink = PaginationLink;
19281
19327
  exports.PaginationNext = PaginationNext;
19282
19328
  exports.PaginationPrevious = PaginationPrevious;
19283
19329
  exports.PhaseGantt = PhaseGantt;
19330
+ exports.Pill = Pill;
19331
+ exports.PillAvatar = PillAvatar;
19332
+ exports.PillAvatarGroup = PillAvatarGroup;
19333
+ exports.PillClose = PillClose;
19334
+ exports.PillDelta = PillDelta;
19335
+ exports.PillIcon = PillIcon;
19336
+ exports.PillStatus = PillStatus;
19284
19337
  exports.PlanningTable = PlanningTable;
19285
19338
  exports.PlanningTableToolbar = PlanningTableToolbar;
19286
19339
  exports.PlanningWeekCommentPopover = PlanningWeekCommentPopover;
@@ -19477,6 +19530,7 @@ exports.isMultiDayEvent = isMultiDayEvent;
19477
19530
  exports.isWorkingHour = isWorkingHour;
19478
19531
  exports.navigateDate = navigateDate;
19479
19532
  exports.navigationMenuTriggerStyle = navigationMenuTriggerStyle;
19533
+ exports.pillVariants = pillVariants;
19480
19534
  exports.playerCanvasPlayButtonVariants = playerCanvasPlayButtonVariants;
19481
19535
  exports.playerCanvasSkipButtonVariants = playerCanvasSkipButtonVariants;
19482
19536
  exports.rangeText = rangeText;