@brightlocal/ui-components 2.14.0 → 2.16.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/README.md CHANGED
@@ -24,7 +24,7 @@ pnpm add @brightlocal/tokens
24
24
 
25
25
  ## Components
26
26
 
27
- This package includes 64 components and 3 blocks built on Radix UI primitives and other React libraries. All components are fully typed with TypeScript and follow BrightLocal's design system patterns.
27
+ This package includes 65 components and 3 blocks built on Radix UI primitives and other React libraries. All components are fully typed with TypeScript and follow BrightLocal's design system patterns.
28
28
 
29
29
  ### Layout Components
30
30
 
@@ -45,6 +45,7 @@ This package includes 64 components and 3 blocks built on Radix UI primitives an
45
45
  - **NavigationMenu** - Complex navigation menus
46
46
  - **Menubar** - Application menu bars
47
47
  - **Pagination** - Page navigation controls
48
+ - **Stepper** - Multi-step process progress indicator
48
49
  - **Tabs** - Tabbed interface components
49
50
 
50
51
  ### Form Components
@@ -105,7 +106,7 @@ This package includes 64 components and 3 blocks built on Radix UI primitives an
105
106
  - **Collapsible** - Collapsible content sections
106
107
  - **Command** - Command palette/search
107
108
  - **Logo** - BrightLocal logo component
108
- - **Map** - Vendor-agnostic map UI primitives: pins, tooltips, controls, legend, loading/error states
109
+ - **Map** - Vendor-agnostic map UI primitives: pins, controls, legend, popover, loading/error states
109
110
  - **Table** - Data tables
110
111
  - **Typography** - Text styling components (headings, paragraphs, blockquotes, lists)
111
112
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.14.0",
3
+ "version": "2.16.0",
4
4
  "description": "Machine-readable registry of all components in the BrightLocal Design System",
5
5
  "components": [
6
6
  {
@@ -426,7 +426,7 @@
426
426
  "props": [
427
427
  "maxWidth"
428
428
  ],
429
- "description": "Content container with consistent styling. Supports a density prop: 'default' uses generous spacing (gap-8, py-section-md, px-section-md) for standalone cards; 'condensed' uses compact spacing (gap-3, py-3, px-3) for cards nested inside other cards as sub-sections, inline stat panels, or dense dashboard widgets.",
429
+ "description": "Content container with consistent styling. Full-width by default — constrain width via className (e.g., className='max-w-sm'). Supports a density prop: 'default' uses generous spacing (gap-8, py-section-md, px-section-md) for standalone cards; 'condensed' uses compact spacing (gap-3, py-3, px-3) for cards nested inside other cards as sub-sections, inline stat panels, or dense dashboard widgets.",
430
430
  "aliases": [
431
431
  "container",
432
432
  "panel",
@@ -439,13 +439,7 @@
439
439
  "Page-level content containers that need consistent padding and border styling",
440
440
  "Nested sub-sections within a parent card — use density='condensed' for compact inline panels (e.g., stat summaries, ranking grids, metric tiles)"
441
441
  ],
442
- "knownGaps": [
443
- {
444
- "description": "CardTitle text size too large for some contexts — smaller variant needed",
445
- "ticket": "DS-535",
446
- "workaround": "Override CardTitle with className='text-lg' or 'text-base' for smaller titles"
447
- }
448
- ],
442
+ "knownGaps": [],
449
443
  "doNotUseFor": [
450
444
  "clickable list items (use List)",
451
445
  "modal content (use Dialog)"
@@ -1429,23 +1423,113 @@
1429
1423
  "import": "@brightlocal/ui-components/map",
1430
1424
  "category": "display",
1431
1425
  "exports": [
1426
+ "MAP_STYLES",
1432
1427
  "MapTypeId",
1433
1428
  "MapLocationPin",
1434
1429
  "MapGridPin",
1430
+ "MapClusterPin",
1431
+ "mapGridPinColorMap",
1432
+ "clusterPinHexColors",
1433
+ "createClusterPinSvg",
1434
+ "createClusterPinElement",
1435
1435
  "MapControlButton",
1436
1436
  "MapLoadingState",
1437
1437
  "MapErrorState",
1438
1438
  "MapLegend",
1439
+ "MapLegendItem",
1439
1440
  "MapPopover",
1440
1441
  "MapPopoverAnchor",
1441
1442
  "MapPopoverContent",
1442
- "useMapPopoverHover"
1443
+ "useMapStyles",
1444
+ "useMapPopoverClick"
1443
1445
  ],
1444
1446
  "compound": true,
1445
1447
  "dataHookRequired": true,
1446
- "variants": {},
1447
- "props": [],
1448
- "description": "Vendor-agnostic map UI primitives: pins, controls, popover, loading/error states"
1448
+ "variants": {
1449
+ "MapStyleVariant": [
1450
+ "default",
1451
+ "muted"
1452
+ ],
1453
+ "MapGridPinVariant": [
1454
+ "strong",
1455
+ "moderate",
1456
+ "weak",
1457
+ "unranked",
1458
+ "error"
1459
+ ]
1460
+ },
1461
+ "hooks": [
1462
+ "useMapStyles",
1463
+ "useMapPopoverClick"
1464
+ ],
1465
+ "props": [
1466
+ "variant",
1467
+ "value",
1468
+ "loading",
1469
+ "animateIn",
1470
+ "icon",
1471
+ "iconOnly",
1472
+ "onRetry",
1473
+ "retryLoading"
1474
+ ],
1475
+ "description": "Vendor-agnostic map UI primitives: pins, controls, popover, loading/error states. Pattern: Recipe, not a component — the DS ships map UI primitives but not a Google Maps wrapper. Includes useMapStyles(variant) hook for built-in map style presets ('default' and 'muted') with automatic dark mode support, and useMapPopoverClick for click-to-open popover state management. MapLoadingState and MapErrorState include a border-border border. When the map has loaded, the consumer owns the container — add 'border border-border rounded-lg' to your map wrapper for consistency.",
1476
+ "aliases": [
1477
+ "map pin",
1478
+ "grid pin",
1479
+ "cluster pin",
1480
+ "map marker",
1481
+ "map controls",
1482
+ "map legend",
1483
+ "map loading",
1484
+ "map error",
1485
+ "local search grid"
1486
+ ],
1487
+ "whenToUse": [
1488
+ "Building a Google Maps integration with the BrightLocal Design System",
1489
+ "Displaying Local Search Grid rank pins on a map",
1490
+ "Clustering grouped map pins into a pie-chart summary",
1491
+ "Adding loading/error placeholder states for map containers",
1492
+ "Building map controls (zoom, locate) as floating overlays",
1493
+ "Adding a color-coded legend bar to map views"
1494
+ ],
1495
+ "doNotUseFor": [
1496
+ "non-map popovers (use Popover directly)",
1497
+ "non-map loading states (use Skeleton or Spinner)"
1498
+ ],
1499
+ "a11yContract": {
1500
+ "MapLoadingState": {
1501
+ "role": "status",
1502
+ "requiresLabel": true
1503
+ },
1504
+ "MapErrorState": {
1505
+ "role": "alert",
1506
+ "requiresLabel": false
1507
+ },
1508
+ "MapLocationPin": {
1509
+ "role": "img",
1510
+ "requiresLabel": true
1511
+ },
1512
+ "MapLegend": {
1513
+ "role": "group",
1514
+ "requiresLabel": true
1515
+ }
1516
+ },
1517
+ "i18nProps": {
1518
+ "MapLocationPin": {
1519
+ "ariaLabel": "string — default: \"Location\""
1520
+ },
1521
+ "MapLoadingState": {
1522
+ "ariaLabel": "string — default: \"Loading map\""
1523
+ },
1524
+ "MapLegend": {
1525
+ "ariaLabel": "string — default: \"Map legend\""
1526
+ },
1527
+ "MapErrorState": {
1528
+ "title": "string — default: \"We couldn't load your map rankings.\"",
1529
+ "message": "string — default: \"Reloading usually fixes it, and it won't use any credits\"",
1530
+ "retryLabel": "string — default: \"Reload\""
1531
+ }
1532
+ }
1449
1533
  },
1450
1534
  {
1451
1535
  "name": "Menubar",
@@ -1968,6 +2052,64 @@
1968
2052
  }
1969
2053
  ]
1970
2054
  },
2055
+ {
2056
+ "name": "Stepper",
2057
+ "import": "@brightlocal/ui-components/stepper",
2058
+ "category": "navigation",
2059
+ "exports": [
2060
+ "Stepper",
2061
+ "StepperNav",
2062
+ "StepperItem",
2063
+ "StepperTrigger",
2064
+ "StepperIndicator",
2065
+ "StepperSeparator",
2066
+ "StepperContent",
2067
+ "StepperTitle",
2068
+ "StepperDescription"
2069
+ ],
2070
+ "compound": true,
2071
+ "dataHookRequired": true,
2072
+ "variants": {
2073
+ "orientation": [
2074
+ "horizontal",
2075
+ "vertical"
2076
+ ],
2077
+ "labelPlacement": [
2078
+ "below",
2079
+ "inline"
2080
+ ],
2081
+ "state": [
2082
+ "active",
2083
+ "completed",
2084
+ "inactive",
2085
+ "error"
2086
+ ]
2087
+ },
2088
+ "props": [
2089
+ "steps",
2090
+ "value",
2091
+ "defaultValue",
2092
+ "onValueChange",
2093
+ "orientation",
2094
+ "labelPlacement",
2095
+ "stepId",
2096
+ "completed",
2097
+ "error",
2098
+ "disabled",
2099
+ "loading"
2100
+ ],
2101
+ "i18nProps": {
2102
+ "Stepper": {
2103
+ "ariaLabel": "string — default: \"Progress\""
2104
+ },
2105
+ "StepperIndicator": {
2106
+ "completedLabel": "string — default: \"Completed\"",
2107
+ "errorLabel": "string — default: \"Error\"",
2108
+ "loadingLabel": "string — default: \"Loading\""
2109
+ }
2110
+ },
2111
+ "description": "Guides users through a multi-step process, showing progress and the current step"
2112
+ },
1971
2113
  {
1972
2114
  "name": "Switch",
1973
2115
  "import": "@brightlocal/ui-components/switch",
package/dist/card.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),O=require("react"),D=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils");function M(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,d.get?d:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const r=M(O),c=r.createContext({flush:!1,density:"default"});function l(e,t){return!e&&(t==="condensed"?"px-3":"px-section-md")}const P=D.cva(["flex","flex-col","rounded-xl","transition-colors","w-full"],{variants:{variant:{filled:["bg-card","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-transparent","text-foreground","border","border-border"],"transparent-flush":["bg-transparent","text-foreground"]},density:{default:["gap-8","py-section-md"],condensed:["gap-3","py-3"]}},defaultVariants:{variant:"filled",density:"default"}}),u=r.forwardRef(({className:e,variant:t="filled",density:a="default",dataHook:d,trackingEl:s,trackingLabel:f,maxWidth:i="400px",children:v,style:N,...j},h)=>{const w=t==="transparent-flush",R=i!==void 0?{maxWidth:typeof i=="number"?`${i}px`:i}:void 0;return o.jsx(c.Provider,{value:{flush:w,density:a},children:o.jsx("div",{ref:h,className:n.cn(P({variant:t,density:a}),e),"data-density":a,"data-hook":d,"data-slot":"card","data-tracking-el":s||`card-${t}`,"data-tracking-label":f,style:{...R,...N},...j,children:v})})});u.displayName="Card";const p=r.forwardRef(({className:e,...t},a)=>{const{flush:d,density:s}=r.useContext(c);return o.jsx("div",{ref:a,className:n.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",l(d,s),e),"data-slot":"card-header",...t})});p.displayName="CardHeader";const m=r.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:n.cn("font-display text-2xl font-medium",e),"data-slot":"card-title",...t}));m.displayName="CardTitle";const C=r.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:n.cn("text-muted-foreground text-sm leading-normal font-normal",e),"data-slot":"card-description",...t}));C.displayName="CardDescription";const x=r.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:n.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),"data-slot":"card-action",...t}));x.displayName="CardAction";const y=r.forwardRef(({className:e,children:t,...a},d)=>{const{flush:s,density:f}=r.useContext(c);return o.jsx("div",{ref:d,className:n.cn(l(s,f),e),"data-slot":"card-media",...a,children:o.jsx("div",{className:"overflow-hidden rounded-md","data-slot":"card-media-clip",children:t})})});y.displayName="CardMedia";const g=r.forwardRef(({className:e,...t},a)=>{const{flush:d,density:s}=r.useContext(c);return o.jsx("div",{ref:a,className:n.cn(l(d,s),e),"data-slot":"card-content",...t})});g.displayName="CardContent";const b=r.forwardRef(({className:e,...t},a)=>{const{flush:d,density:s}=r.useContext(c);return o.jsx("div",{ref:a,className:n.cn("flex items-center",l(d,s),e),"data-slot":"card-footer",...t})});b.displayName="CardFooter";exports.Card=u;exports.CardAction=x;exports.CardContent=g;exports.CardDescription=C;exports.CardFooter=b;exports.CardHeader=p;exports.CardMedia=y;exports.CardTitle=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),T=require("react"),u=require("class-variance-authority"),o=require("@brightlocal/ui-components/lib/utils");function D(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const d=D(T),c=d.createContext({flush:!1,density:"default"});function l(e,a){return!e&&(a==="condensed"?"px-3":"px-section-md")}const V=u.cva(["flex","flex-col","rounded-xl","transition-colors","w-full","max-w-[400px]"],{variants:{variant:{filled:["bg-card","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-transparent","text-foreground","border","border-border"],"transparent-flush":["bg-transparent","text-foreground"]},density:{default:["gap-8","py-section-md"],condensed:["gap-3","py-3"]}},defaultVariants:{variant:"filled",density:"default"}}),m=d.forwardRef(({className:e,variant:a="filled",density:t="default",dataHook:r,trackingEl:n,trackingLabel:f,maxWidth:i,children:N,style:w,...j},h)=>{const R=a==="transparent-flush";d.useEffect(()=>{process.env.NODE_ENV!=="production"&&i!==void 0&&console.warn('Card: the "maxWidth" prop is deprecated. Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").')},[i]);const O=i!==void 0?{maxWidth:typeof i=="number"?`${i}px`:i}:void 0;return s.jsx(c.Provider,{value:{flush:R,density:t},children:s.jsx("div",{ref:h,className:o.cn(V({variant:a,density:t}),e),"data-density":t,"data-hook":r,"data-slot":"card","data-tracking-el":n||`card-${a}`,"data-tracking-label":f,style:{...O,...w},...j,children:N})})});m.displayName="Card";const p=d.forwardRef(({className:e,...a},t)=>{const{flush:r,density:n}=d.useContext(c);return s.jsx("div",{ref:t,className:o.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",l(r,n),e),"data-slot":"card-header",...a})});p.displayName="CardHeader";const _=u.cva("font-display font-medium",{variants:{size:{small:"text-base",default:"text-2xl"}},defaultVariants:{size:"default"}}),x=d.forwardRef(({className:e,size:a="default",...t},r)=>s.jsx("div",{ref:r,className:o.cn(_({size:a}),e),"data-slot":"card-title",...t}));x.displayName="CardTitle";const C=d.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-muted-foreground text-sm leading-normal font-normal",e),"data-slot":"card-description",...a}));C.displayName="CardDescription";const g=d.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),"data-slot":"card-action",...a}));g.displayName="CardAction";const y=d.forwardRef(({className:e,children:a,...t},r)=>{const{flush:n,density:f}=d.useContext(c);return s.jsx("div",{ref:r,className:o.cn(l(n,f),e),"data-slot":"card-media",...t,children:s.jsx("div",{className:"overflow-hidden rounded-md","data-slot":"card-media-clip",children:a})})});y.displayName="CardMedia";const b=d.forwardRef(({className:e,...a},t)=>{const{flush:r,density:n}=d.useContext(c);return s.jsx("div",{ref:t,className:o.cn(l(r,n),e),"data-slot":"card-content",...a})});b.displayName="CardContent";const v=d.forwardRef(({className:e,...a},t)=>{const{flush:r,density:n}=d.useContext(c);return s.jsx("div",{ref:t,className:o.cn("flex items-center",l(r,n),e),"data-slot":"card-footer",...a})});v.displayName="CardFooter";exports.Card=m;exports.CardAction=g;exports.CardContent=b;exports.CardDescription=C;exports.CardFooter=v;exports.CardHeader=p;exports.CardMedia=y;exports.CardTitle=x;
package/dist/card.d.ts CHANGED
@@ -34,8 +34,10 @@ type CardProps = React.ComponentProps<"div"> & {
34
34
  */
35
35
  trackingLabel?: string;
36
36
  /**
37
- * Maximum width of the card (e.g., "420px", "600px", "100%")
38
- * @default "400px"
37
+ * Maximum width of the card (e.g., "420px", "600px", "100%").
38
+ * Cards are full-width by default — use className="max-w-[400px]" instead.
39
+ * @default undefined
40
+ * @deprecated Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").
39
41
  */
40
42
  maxWidth?: string | number;
41
43
  };
@@ -61,10 +63,24 @@ type CardSubComponentProps = React.ComponentProps<"div"> & {
61
63
  * Header section of the Card containing title and description.
62
64
  */
63
65
  declare const CardHeader: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
66
+ /**
67
+ * Size variant for the CardTitle.
68
+ */
69
+ type CardTitleSize = "small" | "default";
70
+ /**
71
+ * Props for the CardTitle component.
72
+ */
73
+ type CardTitleProps = CardSubComponentProps & {
74
+ /**
75
+ * Title text size.
76
+ * @default "default"
77
+ */
78
+ size?: CardTitleSize;
79
+ };
64
80
  /**
65
81
  * Title element within the Card header.
66
82
  */
67
- declare const CardTitle: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
83
+ declare const CardTitle: React.ForwardRefExoticComponent<Omit<CardTitleProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
68
84
  /**
69
85
  * Description text within the Card header.
70
86
  */
@@ -86,5 +102,5 @@ declare const CardContent: React.ForwardRefExoticComponent<Omit<CardSubComponent
86
102
  */
87
103
  declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
88
104
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardMedia, CardContent, };
89
- export type { CardProps, CardSubComponentProps, CardVariant, CardDensity };
105
+ export type { CardProps, CardSubComponentProps, CardTitleProps, CardTitleSize, CardVariant, CardDensity, };
90
106
  //# sourceMappingURL=card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;GAEG;AACH,KAAK,WAAW,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAE7E;;GAEG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AA8C3C;;GAEG;AACH,KAAK,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB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AI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,SAAS,EACT,WAAW,GACZ,CAAC;AAEF,YAAY,EACV,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,GACZ,CAAC"}
package/dist/card.js CHANGED
@@ -1,13 +1,20 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import * as e from "react";
3
- import { cva as g } from "class-variance-authority";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { cva as u } from "class-variance-authority";
4
4
  import { cn as n } from "@brightlocal/ui-components/lib/utils";
5
- const l = e.createContext({ flush: !1, density: "default" });
5
+ const l = r.createContext({ flush: !1, density: "default" });
6
6
  function c(t, a) {
7
7
  return !t && (a === "condensed" ? "px-3" : "px-section-md");
8
8
  }
9
- const N = g(
10
- ["flex", "flex-col", "rounded-xl", "transition-colors", "w-full"],
9
+ const g = u(
10
+ [
11
+ "flex",
12
+ "flex-col",
13
+ "rounded-xl",
14
+ "transition-colors",
15
+ "w-full",
16
+ "max-w-[400px]"
17
+ ],
11
18
  {
12
19
  variants: {
13
20
  variant: {
@@ -36,50 +43,56 @@ const N = g(
36
43
  density: "default"
37
44
  }
38
45
  }
39
- ), v = e.forwardRef(
46
+ ), v = r.forwardRef(
40
47
  ({
41
48
  className: t,
42
49
  variant: a = "filled",
43
- density: r = "default",
44
- dataHook: o,
45
- trackingEl: s,
50
+ density: e = "default",
51
+ dataHook: d,
52
+ trackingEl: o,
46
53
  trackingLabel: f,
47
- maxWidth: i = "400px",
48
- children: u,
49
- style: m,
50
- ...p
54
+ maxWidth: i,
55
+ children: m,
56
+ style: p,
57
+ ...x
51
58
  }, C) => {
52
- const x = a === "transparent-flush", y = i !== void 0 ? {
59
+ const y = a === "transparent-flush";
60
+ r.useEffect(() => {
61
+ process.env.NODE_ENV !== "production" && i !== void 0 && console.warn(
62
+ 'Card: the "maxWidth" prop is deprecated. Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").'
63
+ );
64
+ }, [i]);
65
+ const N = i !== void 0 ? {
53
66
  maxWidth: typeof i == "number" ? `${i}px` : i
54
67
  } : void 0;
55
- return /* @__PURE__ */ d(l.Provider, { value: { flush: x, density: r }, children: /* @__PURE__ */ d(
68
+ return /* @__PURE__ */ s(l.Provider, { value: { flush: y, density: e }, children: /* @__PURE__ */ s(
56
69
  "div",
57
70
  {
58
71
  ref: C,
59
- className: n(N({ variant: a, density: r }), t),
60
- "data-density": r,
61
- "data-hook": o,
72
+ className: n(g({ variant: a, density: e }), t),
73
+ "data-density": e,
74
+ "data-hook": d,
62
75
  "data-slot": "card",
63
- "data-tracking-el": s || `card-${a}`,
76
+ "data-tracking-el": o || `card-${a}`,
64
77
  "data-tracking-label": f,
65
- style: { ...y, ...m },
66
- ...p,
67
- children: u
78
+ style: { ...N, ...p },
79
+ ...x,
80
+ children: m
68
81
  }
69
82
  ) });
70
83
  }
71
84
  );
72
85
  v.displayName = "Card";
73
- const b = e.forwardRef(
74
- ({ className: t, ...a }, r) => {
75
- const { flush: o, density: s } = e.useContext(l);
76
- return /* @__PURE__ */ d(
86
+ const w = r.forwardRef(
87
+ ({ className: t, ...a }, e) => {
88
+ const { flush: d, density: o } = r.useContext(l);
89
+ return /* @__PURE__ */ s(
77
90
  "div",
78
91
  {
79
- ref: r,
92
+ ref: e,
80
93
  className: n(
81
94
  "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",
82
- c(o, s),
95
+ c(d, o),
83
96
  t
84
97
  ),
85
98
  "data-slot": "card-header",
@@ -88,24 +101,34 @@ const b = e.forwardRef(
88
101
  );
89
102
  }
90
103
  );
91
- b.displayName = "CardHeader";
92
- const h = e.forwardRef(
93
- ({ className: t, ...a }, r) => /* @__PURE__ */ d(
104
+ w.displayName = "CardHeader";
105
+ const b = u("font-display font-medium", {
106
+ variants: {
107
+ size: {
108
+ small: "text-base",
109
+ default: "text-2xl"
110
+ }
111
+ },
112
+ defaultVariants: {
113
+ size: "default"
114
+ }
115
+ }), h = r.forwardRef(
116
+ ({ className: t, size: a = "default", ...e }, d) => /* @__PURE__ */ s(
94
117
  "div",
95
118
  {
96
- ref: r,
97
- className: n("font-display text-2xl font-medium", t),
119
+ ref: d,
120
+ className: n(b({ size: a }), t),
98
121
  "data-slot": "card-title",
99
- ...a
122
+ ...e
100
123
  }
101
124
  )
102
125
  );
103
126
  h.displayName = "CardTitle";
104
- const w = e.forwardRef(
105
- ({ className: t, ...a }, r) => /* @__PURE__ */ d(
127
+ const R = r.forwardRef(
128
+ ({ className: t, ...a }, e) => /* @__PURE__ */ s(
106
129
  "div",
107
130
  {
108
- ref: r,
131
+ ref: e,
109
132
  className: n(
110
133
  "text-muted-foreground text-sm leading-normal font-normal",
111
134
  t
@@ -115,12 +138,12 @@ const w = e.forwardRef(
115
138
  }
116
139
  )
117
140
  );
118
- w.displayName = "CardDescription";
119
- const R = e.forwardRef(
120
- ({ className: t, ...a }, r) => /* @__PURE__ */ d(
141
+ R.displayName = "CardDescription";
142
+ const V = r.forwardRef(
143
+ ({ className: t, ...a }, e) => /* @__PURE__ */ s(
121
144
  "div",
122
145
  {
123
- ref: r,
146
+ ref: e,
124
147
  className: n(
125
148
  "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
126
149
  t
@@ -130,48 +153,48 @@ const R = e.forwardRef(
130
153
  }
131
154
  )
132
155
  );
133
- R.displayName = "CardAction";
134
- const k = e.forwardRef(
135
- ({ className: t, children: a, ...r }, o) => {
136
- const { flush: s, density: f } = e.useContext(l);
137
- return /* @__PURE__ */ d(
156
+ V.displayName = "CardAction";
157
+ const T = r.forwardRef(
158
+ ({ className: t, children: a, ...e }, d) => {
159
+ const { flush: o, density: f } = r.useContext(l);
160
+ return /* @__PURE__ */ s(
138
161
  "div",
139
162
  {
140
- ref: o,
141
- className: n(c(s, f), t),
163
+ ref: d,
164
+ className: n(c(o, f), t),
142
165
  "data-slot": "card-media",
143
- ...r,
144
- children: /* @__PURE__ */ d("div", { className: "overflow-hidden rounded-md", "data-slot": "card-media-clip", children: a })
166
+ ...e,
167
+ children: /* @__PURE__ */ s("div", { className: "overflow-hidden rounded-md", "data-slot": "card-media-clip", children: a })
145
168
  }
146
169
  );
147
170
  }
148
171
  );
149
- k.displayName = "CardMedia";
150
- const j = e.forwardRef(
151
- ({ className: t, ...a }, r) => {
152
- const { flush: o, density: s } = e.useContext(l);
153
- return /* @__PURE__ */ d(
172
+ T.displayName = "CardMedia";
173
+ const k = r.forwardRef(
174
+ ({ className: t, ...a }, e) => {
175
+ const { flush: d, density: o } = r.useContext(l);
176
+ return /* @__PURE__ */ s(
154
177
  "div",
155
178
  {
156
- ref: r,
157
- className: n(c(o, s), t),
179
+ ref: e,
180
+ className: n(c(d, o), t),
158
181
  "data-slot": "card-content",
159
182
  ...a
160
183
  }
161
184
  );
162
185
  }
163
186
  );
164
- j.displayName = "CardContent";
165
- const A = e.forwardRef(
166
- ({ className: t, ...a }, r) => {
167
- const { flush: o, density: s } = e.useContext(l);
168
- return /* @__PURE__ */ d(
187
+ k.displayName = "CardContent";
188
+ const D = r.forwardRef(
189
+ ({ className: t, ...a }, e) => {
190
+ const { flush: d, density: o } = r.useContext(l);
191
+ return /* @__PURE__ */ s(
169
192
  "div",
170
193
  {
171
- ref: r,
194
+ ref: e,
172
195
  className: n(
173
196
  "flex items-center",
174
- c(o, s),
197
+ c(d, o),
175
198
  t
176
199
  ),
177
200
  "data-slot": "card-footer",
@@ -180,14 +203,14 @@ const A = e.forwardRef(
180
203
  );
181
204
  }
182
205
  );
183
- A.displayName = "CardFooter";
206
+ D.displayName = "CardFooter";
184
207
  export {
185
208
  v as Card,
186
- R as CardAction,
187
- j as CardContent,
188
- w as CardDescription,
189
- A as CardFooter,
190
- b as CardHeader,
191
- k as CardMedia,
209
+ V as CardAction,
210
+ k as CardContent,
211
+ R as CardDescription,
212
+ D as CardFooter,
213
+ w as CardHeader,
214
+ T as CardMedia,
192
215
  h as CardTitle
193
216
  };