@molecule/app-rating-form-react 1.0.2 → 1.0.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"RatingForm.d.ts","sourceRoot":"","sources":["../src/RatingForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtD,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnE,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wDAAwD;IACxD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oBAAoB;IACpB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,2BAA2B;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,GAAO,EACP,aAAiB,EACjB,cAAc,EACd,KAAK,EACL,kBAAkB,EAClB,WAAW,EACX,SAAS,GACV,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAwE/B"}
1
+ {"version":3,"file":"RatingForm.d.ts","sourceRoot":"","sources":["../src/RatingForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtD,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnE,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wDAAwD;IACxD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oBAAoB;IACpB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,2BAA2B;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,GAAO,EACP,aAAiB,EACjB,cAAc,EACd,KAAK,EACL,kBAAkB,EAClB,WAAW,EACX,SAAS,GACV,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAkF/B"}
@@ -34,12 +34,20 @@ export function RatingForm({ onSubmit, max = 5, defaultRating = 0, requireCommen
34
34
  setSubmitting(false);
35
35
  }
36
36
  }
37
- return (_jsxs("form", { onSubmit: handle, className: cm.cn(cm.stack(3), className), children: [title && _jsx("h3", { className: cm.cn(cm.textSize('base'), cm.fontWeight('semibold')), children: title }), _jsx("div", { role: "radiogroup", "aria-label": t('rating.label', {}, { defaultValue: 'Rating' }), className: cm.flex({ align: 'center', gap: 'xs' }), onMouseLeave: () => setHover(0), children: Array.from({ length: max }, (_, i) => i + 1).map((n) => (_jsx("button", { type: "button", role: "radio", "aria-checked": rating === n, "aria-label": `${n} of ${max}`, onClick: () => setRating(n), onMouseEnter: () => setHover(n), style: {
37
+ return (_jsxs("form", { onSubmit: handle, className: cm.cn(cm.stack(3), className), children: [title && _jsx("h3", { className: cm.cn(cm.textSize('base'), cm.fontWeight('semibold')), children: title }), _jsx("div", { role: "radiogroup", "aria-label": t('rating.label', {}, { defaultValue: 'Rating' }), className: cm.flex({ align: 'center', gap: 'xs' }), onMouseLeave: () => setHover(0), children: Array.from({ length: max }, (_, i) => i + 1).map((n) => (_jsx("button", { type: "button", role: "radio", "data-mol-id": "rating-form-star", "aria-checked": rating === n, "aria-label": t('rating.star', { n, max }, { defaultValue: '{{n}} of {{max}}' }), onClick: () => setRating(n), onMouseEnter: () => setHover(n),
38
+ /* mol-bespoke-button: icon-only 28px star glyph, no label and no
39
+ button surface — the star IS the control, so the inline
40
+ background/border are native resets. Fill colour is a theme
41
+ token now (`#facc15` / `rgba(0,0,0,0.2)` ignored the theme and
42
+ the empty star vanished on a dark surface); 44px touch floor
43
+ from the ClassMap. */
44
+ className: cm.cn(cm.cursorPointer, cm.touchTarget), style: {
38
45
  background: 'none',
39
46
  border: 'none',
40
- cursor: 'pointer',
41
47
  fontSize: 28,
42
- color: n <= display ? '#facc15' : 'rgba(0,0,0,0.2)',
48
+ color: n <= display
49
+ ? 'var(--mol-color-warning, #facc15)'
50
+ : 'var(--mol-color-border, rgba(128,128,128,0.4))',
43
51
  }, children: "\u2605" }, n))) }), _jsx(Textarea, { value: comment, onChange: (e) => setComment(e.target.value), placeholder: commentPlaceholder ??
44
52
  t('rating.commentPlaceholder', {}, { defaultValue: 'Share your thoughts (optional)' }), rows: 4, "aria-label": "Comment" }), _jsx(Button, { type: "submit", variant: "solid", color: "primary", disabled: submitting || !rating, children: submitting
45
53
  ? t('rating.submitting', {}, { defaultValue: 'Submitting…' })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-rating-form-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Interactive star rating + textarea + submit form for collecting reviews",
5
5
  "homepage": "https://www.molecule.dev/packages/app-rating-form-react",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "react": "^18.0.0 || ^19.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@molecule/app-react": "1.5.1",
42
+ "@molecule/app-react": "1.6.0",
43
43
  "@molecule/app-ui": "1.1.1",
44
44
  "@molecule/app-ui-react": "1.0.2",
45
45
  "@types/node": "26.1.2",