@molecule/app-typing-indicator-react 4.0.2 → 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-21T12:47:41.371Z
6
+ Generated: 2026-11-25T09:31:36.791Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-typing-indicator-react
@@ -49,7 +49,7 @@ Props for the {@link TypingIndicator} component.
49
49
  interface TypingIndicatorProps {
50
50
  /** Whether to render. Defaults to true. */
51
51
  visible?: boolean
52
- /** Dot diameter in pixels. Defaults to 6. */
52
+ /** Dot diameter in CSS pixels or native dp. Defaults to 6. */
53
53
  dotSize?: number
54
54
  /** Animation duration in ms. Defaults to 1200. */
55
55
  durationMs?: number
@@ -67,11 +67,8 @@ interface TypingIndicatorProps {
67
67
 
68
68
  #### `TypingIndicator(props)`
69
69
 
70
- Three-dot "typing…" animation. CSS-only (no library dependency) —
71
- uses `@keyframes` defined via inline style tag. Renders three dots
72
- that pulse in sequence. The stylesheet also turns the pulse off under
73
- `prefers-reduced-motion: reduce`, so the dots stay still for users who ask
74
- for less motion (WCAG 2.3.3) instead of relying on a host stylesheet.
70
+ Three-dot "typing…" status. The dots pulse in sequence and stay still when
71
+ the browser or device requests reduced motion.
75
72
 
76
73
  ```typescript
77
74
  function TypingIndicator({
@@ -92,8 +89,8 @@ function TypingIndicator({
92
89
  Peer dependencies:
93
90
 
94
91
  - `@molecule/app-react` ^4.0.0
95
- - `@molecule/app-ui` ^1.0.1
96
- - `@molecule/app-ui-react` ^4.0.0
92
+ - `@molecule/app-ui` ^1.9.0
93
+ - `@molecule/app-ui-react` ^4.7.0
97
94
  - `react` ^18.0.0 || ^19.0.0
98
95
 
99
96
  ### Runtime Dependencies
@@ -3,7 +3,7 @@ import type { JSX } from 'react';
3
3
  export interface TypingIndicatorProps {
4
4
  /** Whether to render. Defaults to true. */
5
5
  visible?: boolean;
6
- /** Dot diameter in pixels. Defaults to 6. */
6
+ /** Dot diameter in CSS pixels or native dp. Defaults to 6. */
7
7
  dotSize?: number;
8
8
  /** Animation duration in ms. Defaults to 1200. */
9
9
  durationMs?: number;
@@ -16,11 +16,8 @@ export interface TypingIndicatorProps {
16
16
  className?: string;
17
17
  }
18
18
  /**
19
- * Three-dot "typing…" animation. CSS-only (no library dependency) —
20
- * uses `@keyframes` defined via inline style tag. Renders three dots
21
- * that pulse in sequence. The stylesheet also turns the pulse off under
22
- * `prefers-reduced-motion: reduce`, so the dots stay still for users who ask
23
- * for less motion (WCAG 2.3.3) instead of relying on a host stylesheet.
19
+ * Three-dot "typing…" status. The dots pulse in sequence and stay still when
20
+ * the browser or device requests reduced motion.
24
21
  * @param props - Component props (see {@link TypingIndicatorProps}).
25
22
  */
26
23
  export declare function TypingIndicator({ visible, dotSize, durationMs, ariaLabel, className, }: TypingIndicatorProps): JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../src/TypingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAKhC,uDAAuD;AACvD,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAc,EACd,OAAW,EACX,UAAiB,EACjB,SAAS,EACT,SAAS,GACV,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAqC3C"}
1
+ {"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../src/TypingIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,uDAAuD;AACvD,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAc,EACd,OAAW,EACX,UAAiB,EACjB,SAAS,EACT,SAAS,GACV,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAe3C"}
@@ -1,12 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useTranslation } from '@molecule/app-react';
3
3
  import { getClassMap } from '@molecule/app-ui';
4
+ import { Box, PulseDots } from '@molecule/app-ui-react/elements';
4
5
  /**
5
- * Three-dot "typing…" animation. CSS-only (no library dependency) —
6
- * uses `@keyframes` defined via inline style tag. Renders three dots
7
- * that pulse in sequence. The stylesheet also turns the pulse off under
8
- * `prefers-reduced-motion: reduce`, so the dots stay still for users who ask
9
- * for less motion (WCAG 2.3.3) instead of relying on a host stylesheet.
6
+ * Three-dot "typing…" status. The dots pulse in sequence and stay still when
7
+ * the browser or device requests reduced motion.
10
8
  * @param props - Component props (see {@link TypingIndicatorProps}).
11
9
  */
12
10
  export function TypingIndicator({ visible = true, dotSize = 6, durationMs = 1200, ariaLabel, className, }) {
@@ -15,20 +13,5 @@ export function TypingIndicator({ visible = true, dotSize = 6, durationMs = 1200
15
13
  if (!visible)
16
14
  return null;
17
15
  const label = ariaLabel ?? t('typingIndicator.aria.label', undefined, { defaultValue: 'Typing…' });
18
- const keyName = 'molecule-typing-pulse';
19
- // The pulse honours `prefers-reduced-motion` in the component's own
20
- // stylesheet: the host stylesheet's global 0.01ms collapse still leaves the
21
- // per-dot stagger delay, so the dots flash in sequence for a reduced-motion
22
- // user and the rendered frame depends on when it is painted.
23
- const css = `@keyframes ${keyName} { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } } @media (prefers-reduced-motion: reduce) { [data-typing-dot] { animation: none !important; } }`;
24
- return (_jsxs("span", { role: "status", "aria-label": label, className: cm.cn(cm.flex({ align: 'center', gap: 'xs' }), className), children: [_jsx("style", { children: css }), [0, 1, 2].map((i) => (_jsx("span", { "aria-hidden": true, "data-typing-dot": "", style: {
25
- display: 'inline-block',
26
- width: dotSize,
27
- height: dotSize,
28
- borderRadius: '50%',
29
- background: 'currentColor',
30
- // One shorthand carries the stagger: mixing it with an `animationDelay`
31
- // longhand makes React warn when `durationMs` changes.
32
- animation: `${keyName} ${durationMs}ms ease-in-out ${(i * durationMs) / 6}ms infinite`,
33
- } }, i)))] }));
16
+ return (_jsx(Box, { as: "span", role: "status", "aria-label": label, className: cm.cn(cm.flex({ align: 'center', gap: 'xs' }), className), children: _jsx(PulseDots, { size: dotSize, durationMs: durationMs }) }));
34
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-typing-indicator-react",
3
- "version": "4.0.2",
3
+ "version": "4.1.0",
4
4
  "description": "Three-dot animated typing indicator for chat UIs",
5
5
  "homepage": "https://www.molecule.dev/packages/app-typing-indicator-react",
6
6
  "type": "module",
@@ -34,14 +34,14 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@molecule/app-react": "^4.0.0",
37
- "@molecule/app-ui": "^1.0.1",
38
- "@molecule/app-ui-react": "^4.0.0",
37
+ "@molecule/app-ui": "^1.9.0",
38
+ "@molecule/app-ui-react": "^4.7.0",
39
39
  "react": "^18.0.0 || ^19.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@molecule/app-react": "4.10.1",
43
- "@molecule/app-ui": "1.5.0",
44
- "@molecule/app-ui-react": "4.2.0",
42
+ "@molecule/app-react": "4.17.0",
43
+ "@molecule/app-ui": "1.13.0",
44
+ "@molecule/app-ui-react": "4.11.0",
45
45
  "@types/node": "26.6.5",
46
46
  "@types/react": "19.3.0",
47
47
  "@types/react-dom": "19.3.0",