@molecule/app-listing-card-react 4.1.1 → 4.2.1
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 -3
- package/dist/ListingCard.d.ts.map +1 -1
- package/dist/ListingCard.js +3 -2
- package/dist/ListingCardActions.d.ts.map +1 -1
- package/dist/ListingCardActions.js +2 -1
- package/dist/ListingCardBody.d.ts.map +1 -1
- package/dist/ListingCardBody.js +2 -1
- package/dist/ListingCardMedia.d.ts.map +1 -1
- package/dist/ListingCardMedia.js +3 -2
- package/dist/ListingGrid.d.ts.map +1 -1
- package/dist/ListingGrid.js +2 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-28T22:54:27.996Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-listing-card-react
|
|
@@ -276,9 +276,9 @@ function ListingGrid({
|
|
|
276
276
|
|
|
277
277
|
Peer dependencies:
|
|
278
278
|
|
|
279
|
-
- `@molecule/app-react` ^4.13.0
|
|
279
|
+
- `@molecule/app-react` ^4.13.0 || ^5.0.0
|
|
280
280
|
- `@molecule/app-ui` ^1.0.1
|
|
281
|
-
- `@molecule/app-ui-react` ^4.
|
|
281
|
+
- `@molecule/app-ui-react` ^4.4.0
|
|
282
282
|
- `react` ^18.0.0 || ^19.0.0
|
|
283
283
|
|
|
284
284
|
### Runtime Dependencies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingCard.d.ts","sourceRoot":"","sources":["../src/ListingCard.tsx"],"names":[],"mappings":"AAAA,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 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useOptimisticValue } from '@molecule/app-react';
|
|
3
3
|
import { getClassMap } from '@molecule/app-ui';
|
|
4
4
|
import { Button, Card } from '@molecule/app-ui-react';
|
|
5
|
+
import { Box, Text } from '@molecule/app-ui-react/elements';
|
|
5
6
|
import { ListingCardActions } from './ListingCardActions.js';
|
|
6
7
|
/**
|
|
7
8
|
* Shows both fields of a card action and saves the person's latest selection.
|
|
@@ -22,7 +23,7 @@ function ListingCardToggle({ value, commit, onError, activeLabel, inactiveLabel,
|
|
|
22
23
|
pressed: !current.pressed,
|
|
23
24
|
count: Math.max(0, current.count + (current.pressed ? -1 : 1)),
|
|
24
25
|
}));
|
|
25
|
-
}, children: [pressed ? activeLabel : inactiveLabel, " ", _jsx("span",
|
|
26
|
+
}, children: [pressed ? activeLabel : inactiveLabel, " ", _jsx(Text, { as: "span", children: count })] }) }));
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* Product / property / listing card shell. Just a `<Card>` with vertical
|
|
@@ -51,5 +52,5 @@ function ListingCardToggle({ value, commit, onError, activeLabel, inactiveLabel,
|
|
|
51
52
|
*/
|
|
52
53
|
export function ListingCard({ children, toggle, onClick, className, dataMolId, }) {
|
|
53
54
|
const cm = getClassMap();
|
|
54
|
-
return (_jsx(Card, { "data-mol-id": dataMolId, onClick: onClick, className: cm.cn(onClick ? cm.cursorPointer : undefined, className), children: _jsxs("div",
|
|
55
|
+
return (_jsx(Card, { "data-mol-id": dataMolId, onClick: onClick, className: cm.cn(onClick ? cm.cursorPointer : undefined, className), children: _jsxs(Box, { as: "div", className: cm.stack(0), children: [children, toggle && _jsx(ListingCardToggle, { ...toggle })] }) }));
|
|
55
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingCardActions.d.ts","sourceRoot":"","sources":["../src/ListingCardActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ListingCardActions.d.ts","sourceRoot":"","sources":["../src/ListingCardActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAK3C,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,QAAQ,EAAE,SAAS,CAAA;IACnB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,MAAqB,EACrB,SAAS,GACV,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAcvC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getClassMap } from '@molecule/app-ui';
|
|
3
|
+
import { Box } from '@molecule/app-ui-react/elements';
|
|
3
4
|
/**
|
|
4
5
|
* Bottom action row of a `<ListingCard>` (Add to cart, Save, etc.).
|
|
5
6
|
* @param props - Component props (see {@link ListingCardActionsProps}).
|
|
6
7
|
*/
|
|
7
8
|
export function ListingCardActions({ children, layout = 'horizontal', className, }) {
|
|
8
9
|
const cm = getClassMap();
|
|
9
|
-
return (_jsx("div",
|
|
10
|
+
return (_jsx(Box, { as: "div", className: cm.cn(cm.flex({ direction: layout === 'stacked' ? 'col' : 'row', gap: 'sm', align: 'stretch' }), cm.sp('p', 3), className), children: children }));
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingCardBody.d.ts","sourceRoot":"","sources":["../src/ListingCardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ListingCardBody.d.ts","sourceRoot":"","sources":["../src/ListingCardBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAM3C,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,4BAA4B;IAC5B,KAAK,EAAE,SAAS,CAAA;IAChB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,SAAS,GACV,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CA2BpC"}
|
package/dist/ListingCardBody.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { slot } from '@molecule/app-react/render';
|
|
3
3
|
import { getClassMap } from '@molecule/app-ui';
|
|
4
|
+
import { Box, Text } from '@molecule/app-ui-react/elements';
|
|
4
5
|
/**
|
|
5
6
|
* Body of a `<ListingCard>` — title / subtitle / price / meta rows stacked.
|
|
6
7
|
* @param props - Component props (see {@link ListingCardBodyProps}).
|
|
@@ -10,5 +11,5 @@ export function ListingCardBody({ title, subtitle: subtitleProp, price: pricePro
|
|
|
10
11
|
const price = slot(priceProp);
|
|
11
12
|
const meta = slot(metaProp);
|
|
12
13
|
const cm = getClassMap();
|
|
13
|
-
return (_jsxs("div",
|
|
14
|
+
return (_jsxs(Box, { as: "div", className: cm.cn(cm.stack(1), cm.sp('p', 3), className), children: [_jsx(Text, { as: "h3", className: cm.cn(cm.textSize('base'), cm.fontWeight('semibold')), children: title }), subtitle && (_jsx(Text, { as: "p", className: cm.textSize('sm'), children: subtitle })), price && (_jsx(Text, { as: "p", className: cm.cn(cm.textSize('lg'), cm.fontWeight('bold')), children: price })), meta && (_jsx(Box, { as: "div", className: cm.flex({ align: 'center', gap: 'sm', wrap: 'wrap' }), children: meta }))] }));
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingCardMedia.d.ts","sourceRoot":"","sources":["../src/ListingCardMedia.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ListingCardMedia.d.ts","sourceRoot":"","sources":["../src/ListingCardMedia.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAM3C,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,uHAAuH;IACvH,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAA;IACvC,qDAAqD;IACrD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,GAAG,EACH,QAAQ,EAAE,YAAY,EACtB,MAAc,EACd,OAAO,EAAE,WAAW,EACpB,SAAS,GACV,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAyBrC"}
|
package/dist/ListingCardMedia.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { slot } from '@molecule/app-react/render';
|
|
3
3
|
import { getClassMap } from '@molecule/app-ui';
|
|
4
|
+
import { Box, Image } from '@molecule/app-ui-react/elements';
|
|
4
5
|
/**
|
|
5
6
|
* Media slot at the top of a `<ListingCard>`. Locks aspect ratio via
|
|
6
7
|
* inline style so apps get consistent card sizing without custom CSS.
|
|
@@ -10,6 +11,6 @@ export function ListingCardMedia({ src, alt, children: childrenProp, aspect = '4
|
|
|
10
11
|
const children = slot(childrenProp);
|
|
11
12
|
const overlay = slot(overlayProp);
|
|
12
13
|
const cm = getClassMap();
|
|
13
|
-
return (_jsxs("div",
|
|
14
|
-
(src && (_jsx(
|
|
14
|
+
return (_jsxs(Box, { as: "div", className: cm.cn(cm.position('relative'), className), webStyle: { aspectRatio: aspect.replace('/', ' / ') }, children: [children ??
|
|
15
|
+
(src && (_jsx(Image, { src: src, alt: alt ?? '', style: { width: '100%', height: '100%', objectFit: 'cover' } }))), overlay && (_jsx(Box, { as: "div", className: cm.cn(cm.position('absolute'), cm.inset0), children: overlay }))] }));
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingGrid.d.ts","sourceRoot":"","sources":["../src/ListingGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ListingGrid.d.ts","sourceRoot":"","sources":["../src/ListingGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAK3C,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAA;IACnB,kEAAkE;IAClE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC/B,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAW,EACX,GAAU,EACV,SAAS,GACV,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAOhC"}
|
package/dist/ListingGrid.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getClassMap } from '@molecule/app-ui';
|
|
3
|
+
import { Box } from '@molecule/app-ui-react/elements';
|
|
3
4
|
/**
|
|
4
5
|
* Grid for `<ListingCard>`s — a fixed `columns`-column grid at every
|
|
5
6
|
* viewport width. Alias for `CardGrid` tuned for listing layouts — same
|
|
@@ -8,5 +9,5 @@ import { getClassMap } from '@molecule/app-ui';
|
|
|
8
9
|
*/
|
|
9
10
|
export function ListingGrid({ children, columns = 3, gap = 'md', className, }) {
|
|
10
11
|
const cm = getClassMap();
|
|
11
|
-
return _jsx("div",
|
|
12
|
+
return (_jsx(Box, { as: "div", className: cm.cn(cm.grid({ cols: columns, gap }), className), children: children }));
|
|
12
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-listing-card-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "React listing/product-card primitives with media, body, actions slots",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-listing-card-react",
|
|
6
6
|
"type": "module",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"directory": "packages/app/features/listing-card-react"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@molecule/app-react": "^4.13.0",
|
|
36
|
+
"@molecule/app-react": "^4.13.0 || ^5.0.0",
|
|
37
37
|
"@molecule/app-ui": "^1.0.1",
|
|
38
|
-
"@molecule/app-ui-react": "^4.
|
|
38
|
+
"@molecule/app-ui-react": "^4.4.0",
|
|
39
39
|
"react": "^18.0.0 || ^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@molecule/app-react": "
|
|
43
|
-
"@molecule/app-ui": "1.
|
|
44
|
-
"@molecule/app-ui-react": "4.
|
|
42
|
+
"@molecule/app-react": "5.0.0",
|
|
43
|
+
"@molecule/app-ui": "1.17.0",
|
|
44
|
+
"@molecule/app-ui-react": "4.15.0",
|
|
45
45
|
"@types/node": "26.6.5",
|
|
46
46
|
"@types/react": "19.3.0",
|
|
47
47
|
"@types/react-dom": "19.3.0",
|