@molecule/app-vote-cluster-react 4.0.0 → 4.1.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
@@ -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-12T04:41:54.755Z
6
+ Generated: 2026-11-25T00:25:48.489Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-vote-cluster-react
@@ -55,7 +55,7 @@ function PostRow({ post }: { post: { id: string; score: number; myVote?: VoteVal
55
55
  ## Installation
56
56
 
57
57
  ```bash
58
- npm install @molecule/app-vote-cluster-react @molecule/app-i18n @molecule/app-react @molecule/app-ui react
58
+ npm install @molecule/app-vote-cluster-react @molecule/app-i18n @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
59
59
  npm install -D @types/react
60
60
  ```
61
61
 
@@ -175,7 +175,8 @@ Peer dependencies:
175
175
 
176
176
  - `@molecule/app-i18n` ^1.0.1
177
177
  - `@molecule/app-react` ^4.0.0
178
- - `@molecule/app-ui` ^1.0.1
178
+ - `@molecule/app-ui` ^1.6.1
179
+ - `@molecule/app-ui-react` ^4.4.0
179
180
  - `react` ^18.0.0 || ^19.0.0
180
181
 
181
182
  ### Runtime Dependencies
@@ -183,6 +184,7 @@ Peer dependencies:
183
184
  - `@molecule/app-i18n`
184
185
  - `@molecule/app-react`
185
186
  - `@molecule/app-ui`
187
+ - `@molecule/app-ui-react`
186
188
  - `react`
187
189
 
188
190
  ## Translations
@@ -1 +1 @@
1
- {"version":3,"file":"VoteCluster.d.ts","sourceRoot":"","sources":["../src/VoteCluster.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAA;AAM/C,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,YAAY,CAAA;AAoD7D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,WAAe,EACf,MAAM,EACN,QAAQ,EACR,SAAsB,EACtB,SAAS,EACT,SAAS,EACT,SAAS,GACV,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CA0HhC"}
1
+ {"version":3,"file":"VoteCluster.d.ts","sourceRoot":"","sources":["../src/VoteCluster.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAOhC,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,YAAY,CAAA;AAoD7D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,WAAe,EACf,MAAM,EACN,QAAQ,EACR,SAAsB,EACtB,SAAS,EACT,SAAS,EACT,SAAS,GACV,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAmIhC"}
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useState } from 'react';
3
3
  import { useTranslation } from '@molecule/app-react';
4
4
  import { getClassMap } from '@molecule/app-ui';
5
+ import { Box, Path, Pressable, Svg, Text } from '@molecule/app-ui-react/elements';
5
6
  /**
6
7
  * Computes the next vote value for a click on the up or down arrow.
7
8
  *
@@ -30,7 +31,7 @@ function nextVote(current, direction) {
30
31
  * @returns The rendered up-arrow SVG.
31
32
  */
32
33
  function UpArrow({ size }) {
33
- return (_jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", "aria-hidden": true, focusable: false, children: _jsx("path", { d: "M12 5l7 9H5l7-9z", fill: "currentColor" }) }));
34
+ return (_jsx(Svg, { width: size, height: size, viewBox: "0 0 24 24", "aria-hidden": true, focusable: false, children: _jsx(Path, { d: "M12 5l7 9H5l7-9z", fill: "currentColor" }) }));
34
35
  }
35
36
  /**
36
37
  * Inline down-arrow SVG, mirroring UpArrow.
@@ -40,7 +41,7 @@ function UpArrow({ size }) {
40
41
  * @returns The rendered down-arrow SVG.
41
42
  */
42
43
  function DownArrow({ size }) {
43
- return (_jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", "aria-hidden": true, focusable: false, children: _jsx("path", { d: "M12 19l-7-9h14l-7 9z", fill: "currentColor" }) }));
44
+ return (_jsx(Svg, { width: size, height: size, viewBox: "0 0 24 24", "aria-hidden": true, focusable: false, children: _jsx(Path, { d: "M12 19l-7-9h14l-7 9z", fill: "currentColor" }) }));
44
45
  }
45
46
  /**
46
47
  * Reddit/HN-style stacked up-arrow + score + down-arrow cluster.
@@ -123,11 +124,11 @@ export function VoteCluster({ score, myVote, defaultVote = 0, onVote, disabled,
123
124
  const wrapperClass = cm.cn(direction === 'vertical'
124
125
  ? cm.flex({ direction: 'col', align: 'center', justify: 'center', gap: 'xs' })
125
126
  : cm.flex({ align: 'center', justify: 'center', gap: 'xs' }), className);
126
- return (_jsxs("div", { className: wrapperClass, role: "group", "aria-label": groupLabel, "data-mol-id": dataMolId, children: [_jsx("button", { type: "button", onClick: () => emit(1), disabled: disabled, "aria-label": upLabel, "aria-pressed": upPressed, "data-vote": "up", "data-mol-id": "vote-cluster-up",
127
+ return (_jsxs(Box, { as: "div", className: wrapperClass, role: "group", "aria-label": groupLabel, "data-mol-id": dataMolId, children: [_jsx(Pressable, { as: "button", type: "button", onClick: () => emit(1), disabled: disabled, "aria-label": upLabel, "aria-pressed": upPressed, "data-vote": "up", "data-mol-id": "vote-cluster-up",
127
128
  // Icon-only arrow: bespoke by design (the arrow IS the control, with no
128
129
  // button surface) and already themed via `--mol-color-*`; the 44px
129
130
  // floor is the one thing it was missing.
130
- className: cm.touchTarget, style: upStyle, children: _jsx(UpArrow, { size: 20 }) }), _jsx("span", { className: cm.cn(cm.textSize('sm'), cm.fontWeight('semibold')), "aria-label": scoreLabel, "aria-live": "polite", "data-vote": "score", style: scoreStyle, children: score }), _jsx("button", { type: "button", onClick: () => emit(-1), disabled: disabled, "aria-label": downLabel, "aria-pressed": downPressed, "data-vote": "down", "data-mol-id": "vote-cluster-down",
131
+ className: cm.touchTarget, webStyle: upStyle, children: _jsx(UpArrow, { size: 20 }) }), _jsx(Text, { as: "span", className: cm.cn(cm.textSize('sm'), cm.fontWeight('semibold')), "aria-label": scoreLabel, "aria-live": "polite", "data-vote": "score", webStyle: scoreStyle, children: score }), _jsx(Pressable, { as: "button", type: "button", onClick: () => emit(-1), disabled: disabled, "aria-label": downLabel, "aria-pressed": downPressed, "data-vote": "down", "data-mol-id": "vote-cluster-down",
131
132
  // Same icon-only arrow as the up vote above.
132
- className: cm.touchTarget, style: downStyle, children: _jsx(DownArrow, { size: 20 }) })] }));
133
+ className: cm.touchTarget, webStyle: downStyle, children: _jsx(DownArrow, { size: 20 }) })] }));
133
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-vote-cluster-react",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Up/down arrows + score; HN/Reddit-style voter cluster",
5
5
  "homepage": "https://www.molecule.dev/packages/app-vote-cluster-react",
6
6
  "type": "module",
@@ -36,19 +36,21 @@
36
36
  "peerDependencies": {
37
37
  "@molecule/app-i18n": "^1.0.1",
38
38
  "@molecule/app-react": "^4.0.0",
39
- "@molecule/app-ui": "^1.0.1",
39
+ "@molecule/app-ui": "^1.6.1",
40
+ "@molecule/app-ui-react": "^4.4.0",
40
41
  "react": "^18.0.0 || ^19.0.0"
41
42
  },
42
43
  "devDependencies": {
43
- "@molecule/app-i18n": "1.1.2",
44
- "@molecule/app-react": "4.0.0",
45
- "@molecule/app-ui": "1.3.9",
46
- "@molecule/app-ui-tailwind": "1.2.9",
44
+ "@molecule/app-i18n": "1.3.0",
45
+ "@molecule/app-react": "4.17.0",
46
+ "@molecule/app-ui": "1.13.0",
47
+ "@molecule/app-ui-react": "4.11.0",
48
+ "@molecule/app-ui-tailwind": "1.5.1",
47
49
  "@testing-library/react": "16.3.3",
48
50
  "@types/node": "26.6.5",
49
51
  "@types/react": "19.3.0",
50
52
  "@types/react-dom": "19.3.0",
51
- "jsdom": "30.1.3",
53
+ "jsdom": "31.0.1",
52
54
  "react": "19.3.1",
53
55
  "react-dom": "19.3.1",
54
56
  "typescript": "6.0.3",