@molecule/app-audio-recorder-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":"AudioRecorder.d.ts","sourceRoot":"","sources":["../src/AudioRecorder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAA;AAMxD,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,YAAY,CAAA;AA0BxE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,OAAO,EACP,QAAQ,EACR,kBAAsB,EACtB,SAAS,EACT,SAAS,GACV,EAAE,kBAAkB,GAAG,YAAY,CA4TnC"}
1
+ {"version":3,"file":"AudioRecorder.d.ts","sourceRoot":"","sources":["../src/AudioRecorder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAA;AAMxD,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,YAAY,CAAA;AA0BxE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,OAAO,EACP,QAAQ,EACR,kBAAsB,EACtB,SAAS,EACT,SAAS,GACV,EAAE,kBAAkB,GAAG,YAAY,CA8TnC"}
@@ -230,22 +230,17 @@ export function AudioRecorder({ onRecorded, onError, mimeType, maxDurationSecond
230
230
  verticalAlign: 'middle',
231
231
  animation: state === 'recording' ? 'mol-pulse 1.2s ease-in-out infinite' : undefined,
232
232
  };
233
- const buttonBase = {
234
- background: 'none',
235
- border: '1px solid currentColor',
236
- padding: '0.4rem 0.9rem',
237
- borderRadius: 6,
238
- cursor: 'pointer',
239
- color: 'inherit',
240
- fontSize: 'inherit',
241
- lineHeight: 1.2,
242
- };
233
+ // Transport actions go through the design system so they match every other
234
+ // labelled action in the app: Record is the one coloured call to action
235
+ // (record-red), the rest are equal-weight outline controls.
236
+ const recordClass = cm.cn(cm.button({ variant: 'solid', color: 'error', size: 'sm' }), cm.touchTargetCompact);
237
+ const transportClass = cm.cn(cm.button({ variant: 'outline', size: 'sm' }), cm.touchTargetCompact);
243
238
  const showRecord = state === 'idle' || state === 'processed' || state === 'error';
244
239
  const showPause = state === 'recording';
245
240
  const showResume = state === 'paused';
246
241
  const showStop = state === 'recording' || state === 'paused';
247
242
  const wrapperClass = cm.cn(cm.flex({ direction: 'col', gap: 'xs' }), className);
248
- return (_jsxs("div", { className: wrapperClass, "data-mol-id": dataMolId ?? 'audio-recorder', "data-state": state, role: "group", "aria-label": t('audioRecorder.group', {}, { defaultValue: 'Audio recorder' }), children: [_jsxs("div", { className: cm.flex({ align: 'center', gap: 'sm' }), children: [_jsx("span", { "aria-hidden": true, style: dotStyle }), _jsx("span", { className: cm.cn(cm.textSize('sm'), cm.fontWeight('semibold')), "data-mol-id": "audio-recorder-status", "aria-live": "polite", children: stateLabel }), _jsx("span", { className: cm.textSize('sm'), "data-mol-id": "audio-recorder-elapsed", "aria-label": elapsedLabel, children: formatDuration(elapsed) })] }), _jsxs("div", { className: cm.flex({ align: 'center', gap: 'sm' }), children: [showRecord && (_jsx("button", { type: "button", onClick: handleStart, "aria-label": recordLabel, "data-action": "record", style: buttonBase, children: recordLabel })), showPause && (_jsx("button", { type: "button", onClick: handlePause, "aria-label": pauseLabel, "data-action": "pause", style: buttonBase, children: pauseLabel })), showResume && (_jsx("button", { type: "button", onClick: handleResume, "aria-label": resumeLabel, "data-action": "resume", style: buttonBase, children: resumeLabel })), showStop && (_jsx("button", { type: "button", onClick: handleStop, "aria-label": stopLabel, "data-action": "stop", style: buttonBase, children: stopLabel }))] }), errorMessage && (_jsx("div", { className: cm.textSize('sm'), role: "alert", "data-mol-id": "audio-recorder-error", style: { color: 'var(--mol-color-error, #e11)' }, children: errorMessage }))] }));
243
+ return (_jsxs("div", { className: wrapperClass, "data-mol-id": dataMolId ?? 'audio-recorder', "data-state": state, role: "group", "aria-label": t('audioRecorder.group', {}, { defaultValue: 'Audio recorder' }), children: [_jsxs("div", { className: cm.flex({ align: 'center', gap: 'sm' }), children: [_jsx("span", { "aria-hidden": true, style: dotStyle }), _jsx("span", { className: cm.cn(cm.textSize('sm'), cm.fontWeight('semibold')), "data-mol-id": "audio-recorder-status", "aria-live": "polite", children: stateLabel }), _jsx("span", { className: cm.textSize('sm'), "data-mol-id": "audio-recorder-elapsed", "aria-label": elapsedLabel, children: formatDuration(elapsed) })] }), _jsxs("div", { className: cm.flex({ align: 'center', gap: 'sm' }), children: [showRecord && (_jsx("button", { type: "button", onClick: handleStart, "aria-label": recordLabel, "data-action": "record", "data-mol-id": "audio-recorder-record", className: recordClass, children: recordLabel })), showPause && (_jsx("button", { type: "button", onClick: handlePause, "aria-label": pauseLabel, "data-action": "pause", "data-mol-id": "audio-recorder-pause", className: transportClass, children: pauseLabel })), showResume && (_jsx("button", { type: "button", onClick: handleResume, "aria-label": resumeLabel, "data-action": "resume", "data-mol-id": "audio-recorder-resume", className: transportClass, children: resumeLabel })), showStop && (_jsx("button", { type: "button", onClick: handleStop, "aria-label": stopLabel, "data-action": "stop", "data-mol-id": "audio-recorder-stop", className: transportClass, children: stopLabel }))] }), errorMessage && (_jsx("div", { className: cm.textSize('sm'), role: "alert", "data-mol-id": "audio-recorder-error", style: { color: 'var(--mol-color-error, #e11)' }, children: errorMessage }))] }));
249
244
  }
250
245
  /**
251
246
  * Compute final recording duration from refs at stop time.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-audio-recorder-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Mic permission + MediaRecorder wrapper that emits a Blob — voice notes, meeting capture, AI voice agents",
5
5
  "homepage": "https://www.molecule.dev/packages/app-audio-recorder-react",
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@molecule/app-i18n": "1.0.2",
45
- "@molecule/app-react": "1.5.1",
45
+ "@molecule/app-react": "1.6.0",
46
46
  "@molecule/app-ui": "1.1.1",
47
47
  "@molecule/app-ui-tailwind": "1.1.3",
48
48
  "@testing-library/dom": "10.4.1",