@brightlocal/ui-components 2.15.0 → 2.17.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.
Files changed (44) hide show
  1. package/component-meta.json +10 -9
  2. package/deprecations.json +189 -0
  3. package/dist/badge.d.ts +1 -1
  4. package/dist/button.d.ts +1 -1
  5. package/dist/card.cjs +1 -1
  6. package/dist/card.d.ts +20 -4
  7. package/dist/card.d.ts.map +1 -1
  8. package/dist/card.js +95 -72
  9. package/dist/chart.cjs +4 -4
  10. package/dist/chart.d.ts +26 -0
  11. package/dist/chart.d.ts.map +1 -1
  12. package/dist/chart.js +75 -59
  13. package/dist/combobox.cjs +3 -3
  14. package/dist/combobox.js +33 -33
  15. package/dist/field.cjs +1 -1
  16. package/dist/field.d.ts.map +1 -1
  17. package/dist/field.js +10 -2
  18. package/dist/global-layout.cjs +1 -1
  19. package/dist/global-layout.d.ts +17 -2
  20. package/dist/global-layout.d.ts.map +1 -1
  21. package/dist/global-layout.js +53 -26
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.js +366 -360
  24. package/dist/map.cjs +1 -1
  25. package/dist/map.d.ts +147 -4
  26. package/dist/map.d.ts.map +1 -1
  27. package/dist/map.js +375 -219
  28. package/dist/rating.cjs +1 -1
  29. package/dist/rating.d.ts +10 -0
  30. package/dist/rating.d.ts.map +1 -1
  31. package/dist/rating.js +38 -33
  32. package/dist/sheet.cjs +1 -1
  33. package/dist/sheet.d.ts +13 -2
  34. package/dist/sheet.d.ts.map +1 -1
  35. package/dist/sheet.js +38 -30
  36. package/package.json +18 -6
  37. package/src/components/card.tsx +62 -8
  38. package/src/components/chart.tsx +39 -1
  39. package/src/components/combobox.tsx +1 -1
  40. package/src/components/field.tsx +9 -1
  41. package/src/components/global-layout.tsx +60 -7
  42. package/src/components/map.tsx +414 -28
  43. package/src/components/rating.tsx +20 -1
  44. package/src/components/sheet.tsx +30 -5
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.15.0",
3
+ "version": "2.17.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)"
@@ -1108,6 +1102,7 @@
1108
1102
  "GlobalLayout",
1109
1103
  "GlobalLayoutSidebar",
1110
1104
  "GlobalLayoutContent",
1105
+ "GlobalLayoutContentActions",
1111
1106
  "GlobalLayoutContentHeader",
1112
1107
  "GlobalLayoutContentBody",
1113
1108
  "GlobalLayoutMobileHeader"
@@ -1433,7 +1428,11 @@
1433
1428
  "MapTypeId",
1434
1429
  "MapLocationPin",
1435
1430
  "MapGridPin",
1431
+ "MapClusterPin",
1436
1432
  "mapGridPinColorMap",
1433
+ "clusterPinHexColors",
1434
+ "createClusterPinSvg",
1435
+ "createClusterPinElement",
1437
1436
  "MapControlButton",
1438
1437
  "MapLoadingState",
1439
1438
  "MapErrorState",
@@ -1478,6 +1477,7 @@
1478
1477
  "aliases": [
1479
1478
  "map pin",
1480
1479
  "grid pin",
1480
+ "cluster pin",
1481
1481
  "map marker",
1482
1482
  "map controls",
1483
1483
  "map legend",
@@ -1488,6 +1488,7 @@
1488
1488
  "whenToUse": [
1489
1489
  "Building a Google Maps integration with the BrightLocal Design System",
1490
1490
  "Displaying Local Search Grid rank pins on a map",
1491
+ "Clustering grouped map pins into a pie-chart summary",
1491
1492
  "Adding loading/error placeholder states for map containers",
1492
1493
  "Building map controls (zoom, locate) as floating overlays",
1493
1494
  "Adding a color-coded legend bar to map views"
@@ -0,0 +1,189 @@
1
+ [
2
+ {
3
+ "id": "split-layout-left",
4
+ "component": "SplitLayout",
5
+ "file": "components/split-layout.tsx",
6
+ "item": "left",
7
+ "type": "prop",
8
+ "since": "1.2.0",
9
+ "reason": "Use <SplitLayoutContentLeft> composition instead",
10
+ "replacement": "SplitLayoutContentLeft component",
11
+ "ticket": "DS-450"
12
+ },
13
+ {
14
+ "id": "split-layout-right",
15
+ "component": "SplitLayout",
16
+ "file": "components/split-layout.tsx",
17
+ "item": "right",
18
+ "type": "prop",
19
+ "since": "1.2.0",
20
+ "reason": "Use <SplitLayoutContentRight> composition instead",
21
+ "replacement": "SplitLayoutContentRight component",
22
+ "ticket": "DS-450"
23
+ },
24
+ {
25
+ "id": "use-mobile-module",
26
+ "component": "use-mobile",
27
+ "file": "hooks/use-mobile.ts",
28
+ "item": "use-mobile.ts",
29
+ "type": "hook",
30
+ "since": "2.9.0",
31
+ "reason": "Module replaced by use-breakpoint",
32
+ "replacement": "@brightlocal/ui-components/hooks/use-breakpoint",
33
+ "ticket": ""
34
+ },
35
+ {
36
+ "id": "use-mobile-get-breakpoint",
37
+ "component": "use-mobile",
38
+ "file": "hooks/use-mobile.ts",
39
+ "item": "getMobileBreakpoint",
40
+ "type": "export",
41
+ "since": "2.9.0",
42
+ "reason": "Replaced by getBreakpointValue()",
43
+ "replacement": "getBreakpointValue()",
44
+ "ticket": ""
45
+ },
46
+ {
47
+ "id": "use-mobile-use-is-mobile",
48
+ "component": "use-mobile",
49
+ "file": "hooks/use-mobile.ts",
50
+ "item": "useIsMobile",
51
+ "type": "export",
52
+ "since": "2.9.0",
53
+ "reason": "Replaced by useIsBelowBreakpoint(\"sm\")",
54
+ "replacement": "useIsBelowBreakpoint(\"sm\")",
55
+ "ticket": ""
56
+ },
57
+ {
58
+ "id": "sidebar-embedded",
59
+ "component": "Sidebar",
60
+ "file": "blocks/sidebar.tsx",
61
+ "item": "embedded",
62
+ "type": "prop",
63
+ "since": "2.9.0",
64
+ "reason": "Sidebar now always uses inline layout",
65
+ "replacement": "Remove prop (no replacement needed)",
66
+ "ticket": ""
67
+ },
68
+ {
69
+ "id": "sidebar-drawer",
70
+ "component": "Sidebar",
71
+ "file": "blocks/sidebar.tsx",
72
+ "item": "SidebarDrawer",
73
+ "type": "component",
74
+ "since": "2.9.0",
75
+ "reason": "Use SidebarTrigger instead",
76
+ "replacement": "SidebarTrigger",
77
+ "ticket": ""
78
+ },
79
+ {
80
+ "id": "sidebar-drawer-props",
81
+ "component": "Sidebar",
82
+ "file": "blocks/sidebar.tsx",
83
+ "item": "SidebarDrawerProps",
84
+ "type": "type",
85
+ "since": "2.9.0",
86
+ "reason": "Paired with deprecated SidebarDrawer component",
87
+ "replacement": "SidebarTriggerProps",
88
+ "ticket": ""
89
+ },
90
+ {
91
+ "id": "map-satellite",
92
+ "component": "Map",
93
+ "file": "components/map.tsx",
94
+ "item": "MapTypeId.SATELLITE",
95
+ "type": "constant",
96
+ "since": "2.15.0",
97
+ "reason": "Prefer cloud-based map styling via Map ID",
98
+ "replacement": "Cloud-based Map Styling (Map ID parameter)",
99
+ "ticket": ""
100
+ },
101
+ {
102
+ "id": "map-legacy-variant",
103
+ "component": "Map",
104
+ "file": "components/map.tsx",
105
+ "item": "LegacyVariant",
106
+ "type": "type",
107
+ "since": "2.15.0",
108
+ "reason": "Legacy variant names replaced by semantic ranking names",
109
+ "replacement": "ResolvedVariant (strong, moderate, weak, unranked, error)",
110
+ "ticket": "DS-562"
111
+ },
112
+ {
113
+ "id": "map-legacy-variant-map",
114
+ "component": "Map",
115
+ "file": "components/map.tsx",
116
+ "item": "legacyVariantMap",
117
+ "type": "constant",
118
+ "since": "2.15.0",
119
+ "reason": "Internal helper for legacy variant names",
120
+ "replacement": "Use ResolvedVariant directly",
121
+ "ticket": "DS-562"
122
+ },
123
+ {
124
+ "id": "map-grid-pin-pulse",
125
+ "component": "MapGridPin",
126
+ "file": "components/map.tsx",
127
+ "item": "pulse",
128
+ "type": "prop",
129
+ "since": "2.15.0",
130
+ "reason": "No longer rendered",
131
+ "replacement": "Remove prop",
132
+ "ticket": "DS-562"
133
+ },
134
+ {
135
+ "id": "map-cluster-pin-hex-colors",
136
+ "component": "Map",
137
+ "file": "components/map.tsx",
138
+ "item": "clusterPinHexColors",
139
+ "type": "constant",
140
+ "since": "2.16.0",
141
+ "reason": "Static snapshot may be stale",
142
+ "replacement": "resolveClusterPinColors()",
143
+ "ticket": ""
144
+ },
145
+ {
146
+ "id": "map-location-pin-value",
147
+ "component": "MapLocationPin",
148
+ "file": "components/map.tsx",
149
+ "item": "value",
150
+ "type": "prop",
151
+ "since": "2.15.0",
152
+ "reason": "Use MapGridPin for numbered pins",
153
+ "replacement": "MapGridPin value prop",
154
+ "ticket": "DS-563"
155
+ },
156
+ {
157
+ "id": "map-location-pin-variant",
158
+ "component": "MapLocationPin",
159
+ "file": "components/map.tsx",
160
+ "item": "variant",
161
+ "type": "prop",
162
+ "since": "2.15.0",
163
+ "reason": "Use MapGridPin for numbered pins",
164
+ "replacement": "MapGridPin variant prop",
165
+ "ticket": "DS-563"
166
+ },
167
+ {
168
+ "id": "map-location-pin-pulse",
169
+ "component": "MapLocationPin",
170
+ "file": "components/map.tsx",
171
+ "item": "pulse",
172
+ "type": "prop",
173
+ "since": "2.15.0",
174
+ "reason": "Use MapGridPin for numbered pins",
175
+ "replacement": "MapGridPin (pulse no longer rendered)",
176
+ "ticket": "DS-563"
177
+ },
178
+ {
179
+ "id": "card-max-width",
180
+ "component": "Card",
181
+ "file": "components/card.tsx",
182
+ "item": "maxWidth",
183
+ "type": "prop",
184
+ "since": "2.16.0",
185
+ "reason": "Use Tailwind max-width utilities via className instead",
186
+ "replacement": "className=\"max-w-sm\" (or any max-w-* utility)",
187
+ "ticket": "DS-578"
188
+ }
189
+ ]
package/dist/badge.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "destructive" | "primary" | "outline" | "secondary" | null | undefined;
4
+ variant?: "outline" | "destructive" | "primary" | "secondary" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  /**
7
7
  * Props for the Badge component
package/dist/button.d.ts CHANGED
@@ -17,7 +17,7 @@ type ButtonVariantProps = {
17
17
  /** Supported visual style variants for the Button component. */
18
18
  export type ButtonVariant = NonNullable<ButtonVariantProps["variant"]>;
19
19
  declare const ButtonVariants: (props?: ({
20
- variant?: "ghost" | "destructive" | "warning" | "primary" | "outline" | "secondary" | null | undefined;
20
+ variant?: "ghost" | "outline" | "destructive" | "warning" | "primary" | "secondary" | null | undefined;
21
21
  size?: "default" | "sm" | "lg" | null | undefined;
22
22
  state?: "default" | "disabled" | "loading" | null | undefined;
23
23
  fullWidth?: boolean | null | undefined;
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;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,IAAI,+FA2CT,CAAC;AAIF;;GAEG;AACH,KAAK,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IACzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAgBf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,SAAS,2GASd,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,eAAe,2GAYpB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAYf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,SAAS,2GAgBd,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,WAAW,2GAYhB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAgBf,CAAC;AAGF,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,SAAS,EACT,WAAW,GACZ,CAAC;AAEF,YAAY,EAAE,SAAS,EAAE,qBAAqB,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAEA,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;AAqD3C;;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;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,IAAI,+FAmDT,CAAC;AAIF;;GAEG;AACH,KAAK,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IACzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAgBf,CAAC;AAGF;;GAEG;AACH,KAAK,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAczC;;GAEG;AACH,KAAK,cAAc,GAAG,qBAAqB,GAAG;IAC5C;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,SAAS,oGASd,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,eAAe,2GAYpB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAYf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,SAAS,2GAgBd,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,WAAW,2GAYhB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAgBf,CAAC;AAGF,OAAO,EACL,IAAI,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
  };