@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 +3 -2
- package/component-meta.json +155 -13
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +20 -4
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +95 -72
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.js +33 -33
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +8 -2
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +24 -21
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +326 -307
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +21 -15
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +402 -46
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +615 -184
- package/dist/stepper.cjs +1 -0
- package/dist/stepper.d.ts +176 -0
- package/dist/stepper.d.ts.map +1 -0
- package/dist/stepper.js +351 -0
- package/package.json +12 -2
- package/src/components/card.tsx +62 -8
- package/src/components/combobox.tsx +1 -1
- package/src/components/field.tsx +7 -1
- package/src/components/global-layout.tsx +4 -1
- package/src/components/list.tsx +8 -2
- package/src/components/map.tsx +1068 -135
- package/src/components/stepper.tsx +708 -0
- package/src/index.ts +1 -0
- package/src/types/assets.d.ts +9 -0
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ pnpm add @brightlocal/tokens
|
|
|
24
24
|
|
|
25
25
|
## Components
|
|
26
26
|
|
|
27
|
-
This package includes
|
|
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,
|
|
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
|
|
package/component-meta.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightlocal/ui-components",
|
|
3
|
-
"version": "2.
|
|
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
|
-
"
|
|
1443
|
+
"useMapStyles",
|
|
1444
|
+
"useMapPopoverClick"
|
|
1443
1445
|
],
|
|
1444
1446
|
"compound": true,
|
|
1445
1447
|
"dataHookRequired": true,
|
|
1446
|
-
"variants": {
|
|
1447
|
-
|
|
1448
|
-
|
|
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
|
|
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
|
-
*
|
|
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<
|
|
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
|
package/dist/card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"
|
|
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
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
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 =
|
|
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
|
|
10
|
-
[
|
|
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 =
|
|
46
|
+
), v = r.forwardRef(
|
|
40
47
|
({
|
|
41
48
|
className: t,
|
|
42
49
|
variant: a = "filled",
|
|
43
|
-
density:
|
|
44
|
-
dataHook:
|
|
45
|
-
trackingEl:
|
|
50
|
+
density: e = "default",
|
|
51
|
+
dataHook: d,
|
|
52
|
+
trackingEl: o,
|
|
46
53
|
trackingLabel: f,
|
|
47
|
-
maxWidth: i
|
|
48
|
-
children:
|
|
49
|
-
style:
|
|
50
|
-
...
|
|
54
|
+
maxWidth: i,
|
|
55
|
+
children: m,
|
|
56
|
+
style: p,
|
|
57
|
+
...x
|
|
51
58
|
}, C) => {
|
|
52
|
-
const
|
|
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__ */
|
|
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(
|
|
60
|
-
"data-density":
|
|
61
|
-
"data-hook":
|
|
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":
|
|
76
|
+
"data-tracking-el": o || `card-${a}`,
|
|
64
77
|
"data-tracking-label": f,
|
|
65
|
-
style: { ...
|
|
66
|
-
...
|
|
67
|
-
children:
|
|
78
|
+
style: { ...N, ...p },
|
|
79
|
+
...x,
|
|
80
|
+
children: m
|
|
68
81
|
}
|
|
69
82
|
) });
|
|
70
83
|
}
|
|
71
84
|
);
|
|
72
85
|
v.displayName = "Card";
|
|
73
|
-
const
|
|
74
|
-
({ className: t, ...a },
|
|
75
|
-
const { flush:
|
|
76
|
-
return /* @__PURE__ */
|
|
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:
|
|
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(
|
|
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
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
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:
|
|
97
|
-
className: n(
|
|
119
|
+
ref: d,
|
|
120
|
+
className: n(b({ size: a }), t),
|
|
98
121
|
"data-slot": "card-title",
|
|
99
|
-
...
|
|
122
|
+
...e
|
|
100
123
|
}
|
|
101
124
|
)
|
|
102
125
|
);
|
|
103
126
|
h.displayName = "CardTitle";
|
|
104
|
-
const
|
|
105
|
-
({ className: t, ...a },
|
|
127
|
+
const R = r.forwardRef(
|
|
128
|
+
({ className: t, ...a }, e) => /* @__PURE__ */ s(
|
|
106
129
|
"div",
|
|
107
130
|
{
|
|
108
|
-
ref:
|
|
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
|
-
|
|
119
|
-
const
|
|
120
|
-
({ className: t, ...a },
|
|
141
|
+
R.displayName = "CardDescription";
|
|
142
|
+
const V = r.forwardRef(
|
|
143
|
+
({ className: t, ...a }, e) => /* @__PURE__ */ s(
|
|
121
144
|
"div",
|
|
122
145
|
{
|
|
123
|
-
ref:
|
|
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
|
-
|
|
134
|
-
const
|
|
135
|
-
({ className: t, children: a, ...
|
|
136
|
-
const { flush:
|
|
137
|
-
return /* @__PURE__ */
|
|
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:
|
|
141
|
-
className: n(c(
|
|
163
|
+
ref: d,
|
|
164
|
+
className: n(c(o, f), t),
|
|
142
165
|
"data-slot": "card-media",
|
|
143
|
-
...
|
|
144
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
150
|
-
const
|
|
151
|
-
({ className: t, ...a },
|
|
152
|
-
const { flush:
|
|
153
|
-
return /* @__PURE__ */
|
|
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:
|
|
157
|
-
className: n(c(
|
|
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
|
-
|
|
165
|
-
const
|
|
166
|
-
({ className: t, ...a },
|
|
167
|
-
const { flush:
|
|
168
|
-
return /* @__PURE__ */
|
|
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:
|
|
194
|
+
ref: e,
|
|
172
195
|
className: n(
|
|
173
196
|
"flex items-center",
|
|
174
|
-
c(
|
|
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
|
-
|
|
206
|
+
D.displayName = "CardFooter";
|
|
184
207
|
export {
|
|
185
208
|
v as Card,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
};
|