@usableapp/cardds 0.7.75 → 0.7.77

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.
@@ -28,5 +28,8 @@ export interface StampPlaceProps extends Omit<ComponentProps<'span'>, 'onClick'>
28
28
  /** the place is a button ("make yours"): it renders a `<button>` */
29
29
  onClick?: () => void;
30
30
  }
31
- /** StampPlace — an empty place for a stamp: a dashed 4:5 frame the size a Stamp would be, a word or an Icon inside. */
32
- export declare function StampPlace({ faint, onClick, className, ...rest }: StampPlaceProps): import("react").JSX.Element;
31
+ /**
32
+ * StampPlace — an empty place for a stamp: a dashed 4:5 frame the size a Stamp would be, a word or an Icon inside.
33
+ * The dashes are a stroke, not a border: `--stamp-place-dash` and `--stamp-place-gap` set them.
34
+ */
35
+ export declare function StampPlace({ faint, onClick, className, children, ...rest }: StampPlaceProps): import("react").JSX.Element;
@@ -12,10 +12,13 @@ export function Stamp({ pictures, tone = 'custard', name, words, bare, tilt, onC
12
12
  const boxProps = (tap ? { type: 'button', onClick, ...rest } : rest);
13
13
  return (_jsx(Box, { className: cx('stamp', `stamp--${shown.length}`, bare && 'stamp--bare', tilt && `stamp--tilt-${tilt}`, tap && 'stamp--tap', className), ...boxProps, children: _jsx("span", { className: "stamp__paper", children: _jsxs("span", { className: cx('stamp__pic', `sticky--${tone}`), children: [shown.map((picture, i) => _jsx("span", { className: "stamp__art", "aria-hidden": "true", children: picture }, i)), (name != null || words != null) && (_jsxs("span", { className: "stamp__cap", children: [words != null && _jsx("span", { className: "stamp__words", children: words }), name != null && _jsx("span", { className: "stamp__name", children: name })] }))] }) }) }));
14
14
  }
15
- /** StampPlace — an empty place for a stamp: a dashed 4:5 frame the size a Stamp would be, a word or an Icon inside. */
16
- export function StampPlace({ faint, onClick, className, ...rest }) {
15
+ /**
16
+ * StampPlace — an empty place for a stamp: a dashed 4:5 frame the size a Stamp would be, a word or an Icon inside.
17
+ * The dashes are a stroke, not a border: `--stamp-place-dash` and `--stamp-place-gap` set them.
18
+ */
19
+ export function StampPlace({ faint, onClick, className, children, ...rest }) {
17
20
  const tap = onClick != null;
18
21
  const Box = (tap ? 'button' : 'span');
19
22
  const boxProps = (tap ? { type: 'button', onClick, ...rest } : rest);
20
- return _jsx(Box, { className: cx('stamp-place', faint && 'stamp-place--faint', className), ...boxProps });
23
+ return (_jsxs(Box, { className: cx('stamp-place', faint && 'stamp-place--faint', className), ...boxProps, children: [_jsx("svg", { className: "stamp-place__edge", "aria-hidden": "true", focusable: "false", children: _jsx("rect", {}) }), children] }));
21
24
  }
@@ -5,7 +5,7 @@ import { Icon } from '../type/Icon.js';
5
5
  import { StampPlace } from './Stamp.js';
6
6
  /** StampBook — the album page: StampCells three across on an album ground, the free places drawn empty up to `places`. */
7
7
  export function StampBook({ places = 0, strip, bare, className, children, ...rest }) {
8
- const free = Math.max(0, places - Children.count(children));
8
+ const free = Math.max(0, places - Children.toArray(children).length); // toArray drops null / undefined / booleans: `{owned && <StampCell/>}` that is false holds no place (Children.count counts it)
9
9
  return (_jsxs("div", { className: cx('stamp-book', strip && 'stamp-book--strip', bare && 'stamp-book--bare', className), ...rest, children: [children, Array.from({ length: free }, (_, i) => _jsx(StampPlace, { faint: true, "aria-hidden": "true" }, i))] }));
10
10
  }
11
11
  /** StampCell — one place of a StampBook: a Stamp (the child) and a short label under it. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usableapp/cardds",
3
- "version": "0.7.75",
3
+ "version": "0.7.77",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "description": "card-first mobile design system, React-first: the components in src/ are thin wrappers over the CSS contract (css/*.css stays the only truth); gallery/ shows every story live (npm run dev), tests/ measures the geometry.",