@molecule/app-typing-indicator-solid 1.1.0 → 1.1.1

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-15T07:10:27.387Z
6
+ Generated: 2026-11-21T12:47:41.520Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-typing-indicator-solid
@@ -54,7 +54,10 @@ interface TypingIndicatorProps {
54
54
  dotSize?: number
55
55
  /** Animation duration in ms. Defaults to 1200. */
56
56
  durationMs?: number
57
- /** Accessible label. */
57
+ /**
58
+ * Accessible label. Overrides the translated / `defaultValue` `'Typing…'`
59
+ * (prop > `t()` > default).
60
+ */
58
61
  ariaLabel?: string
59
62
  /** Extra classes. */
60
63
  className?: string
@@ -67,7 +70,9 @@ interface TypingIndicatorProps {
67
70
 
68
71
  Three-dot "typing…" animation. CSS-only (no library dependency) —
69
72
  uses `@keyframes` defined via inline style tag. Renders three dots
70
- that pulse in sequence.
73
+ that pulse in sequence. The stylesheet also turns the pulse off under
74
+ `prefers-reduced-motion: reduce`, so the dots stay still for users who ask
75
+ for less motion (WCAG 2.3.3) instead of relying on a host stylesheet.
71
76
 
72
77
  ```typescript
73
78
  function TypingIndicator(props: TypingIndicatorProps): JSX.Element
@@ -97,9 +102,13 @@ Peer dependencies:
97
102
 
98
103
  Dots use `currentColor`, so the indicator inherits the surrounding text
99
104
  color — wrap it in a muted-text container to dim it. The default
100
- `ariaLabel` is hardcoded English 'Typing…' (React parity) and there is no
101
- companion locale bond: pass a translated `ariaLabel` in non-English apps.
102
- Each instance injects its own `<style>` tag for the keyframes (fine for a
103
- chat view; avoid hundreds at once). Props (documented on the exported
104
- `TypingIndicatorProps` interface): visible (default true), dotSize (px,
105
- default 6), durationMs (default 1200), ariaLabel, className.
105
+ `ariaLabel` is the translated `typingIndicator.aria.label` (English
106
+ `'Typing…'`, via `@molecule/app-locales-typing-indicator`); the `ariaLabel`
107
+ prop overrides it. Each instance injects its own `<style>` tag for the
108
+ keyframes (fine for a chat view; avoid hundreds at once). Props (documented
109
+ on the exported `TypingIndicatorProps` interface): visible (default true),
110
+ dotSize (px, default 6), durationMs (default 1200), ariaLabel, className.
111
+
112
+ ## Translations
113
+
114
+ Translation strings are provided by `@molecule/app-locales-typing-indicator`.
@@ -12,7 +12,9 @@ import type { TypingIndicatorProps } from './types.js';
12
12
  /**
13
13
  * Three-dot "typing…" animation. CSS-only (no library dependency) —
14
14
  * uses `@keyframes` defined via inline style tag. Renders three dots
15
- * that pulse in sequence.
15
+ * that pulse in sequence. The stylesheet also turns the pulse off under
16
+ * `prefers-reduced-motion: reduce`, so the dots stay still for users who ask
17
+ * for less motion (WCAG 2.3.3) instead of relying on a host stylesheet.
16
18
  *
17
19
  * @param props - Component props (see {@link TypingIndicatorProps}).
18
20
  * @returns The rendered typing indicator.
@@ -1 +1 @@
1
- {"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../src/TypingIndicator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,UAAU,CAAA;AAIpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAQtD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,oBAAoB,CA4B3D,CAAA"}
1
+ {"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../src/TypingIndicator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,UAAU,CAAA;AAKpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAQtD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,oBAAoB,CAiC3D,CAAA"}
@@ -8,26 +8,32 @@
8
8
  * @module
9
9
  */
10
10
  import { For, Show } from 'solid-js';
11
+ import { useTranslation } from '@molecule/app-solid';
11
12
  import { getClassMap } from '@molecule/app-ui';
12
13
  /** The shared `@keyframes` rule the dots animate with. */
13
14
  const KEYFRAMES_NAME = 'molecule-typing-pulse';
14
- /** The injected `@keyframes` rule, written once per indicator. */
15
- const keyframesCss = `@keyframes ${KEYFRAMES_NAME} { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }`;
15
+ /** The stylesheet the indicator injects: the pulse and its reduced-motion opt-out. */
16
+ const keyframesCss = `@keyframes ${KEYFRAMES_NAME} { 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; } }`;
16
17
  /**
17
18
  * Three-dot "typing…" animation. CSS-only (no library dependency) —
18
19
  * uses `@keyframes` defined via inline style tag. Renders three dots
19
- * that pulse in sequence.
20
+ * that pulse in sequence. The stylesheet also turns the pulse off under
21
+ * `prefers-reduced-motion: reduce`, so the dots stay still for users who ask
22
+ * for less motion (WCAG 2.3.3) instead of relying on a host stylesheet.
20
23
  *
21
24
  * @param props - Component props (see {@link TypingIndicatorProps}).
22
25
  * @returns The rendered typing indicator.
23
26
  */
24
27
  export const TypingIndicator = (props) => {
28
+ const { t } = useTranslation();
25
29
  const cm = getClassMap();
30
+ /** The label: the prop when given, else the translated default. */
31
+ const label = () => props.ariaLabel ?? t('typingIndicator.aria.label', undefined, { defaultValue: 'Typing…' });
26
32
  return (<Show when={props.visible ?? true}>
27
- <span role="status" aria-label={props.ariaLabel ?? 'Typing…'} class={cm.cn(cm.flex({ align: 'center', gap: 'xs' }), props.className)}>
33
+ <span role="status" aria-label={label()} class={cm.cn(cm.flex({ align: 'center', gap: 'xs' }), props.className)}>
28
34
  <style>{keyframesCss}</style>
29
35
  <For each={[0, 1, 2]}>
30
- {(i) => (<span aria-hidden="true" style={{
36
+ {(i) => (<span aria-hidden="true" data-typing-dot="" style={{
31
37
  display: 'inline-block',
32
38
  width: `${props.dotSize ?? 6}px`,
33
39
  height: `${props.dotSize ?? 6}px`,
@@ -1 +1 @@
1
- {"version":3,"file":"TypingIndicator.jsx","sourceRoot":"","sources":["../src/TypingIndicator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAI9C,0DAA0D;AAC1D,MAAM,cAAc,GAAG,uBAAuB,CAAA;AAE9C,kEAAkE;AAClE,MAAM,YAAY,GAAG,cAAc,cAAc,sGAAsG,CAAA;AAEvJ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoC,CAAC,KAAK,EAAE,EAAE;IACxE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;IACxB,OAAO,CACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,CAChC;MAAA,CAAC,IAAI,CACH,IAAI,CAAC,QAAQ,CACb,UAAU,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC,CACzC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAEvE;QAAA,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,EAAE,KAAK,CAC5B;QAAA,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CA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dist/index.d.ts CHANGED
@@ -17,12 +17,12 @@
17
17
  * @remarks
18
18
  * Dots use `currentColor`, so the indicator inherits the surrounding text
19
19
  * color — wrap it in a muted-text container to dim it. The default
20
- * `ariaLabel` is hardcoded English 'Typing…' (React parity) and there is no
21
- * companion locale bond: pass a translated `ariaLabel` in non-English apps.
22
- * Each instance injects its own `<style>` tag for the keyframes (fine for a
23
- * chat view; avoid hundreds at once). Props (documented on the exported
24
- * `TypingIndicatorProps` interface): visible (default true), dotSize (px,
25
- * default 6), durationMs (default 1200), ariaLabel, className.
20
+ * `ariaLabel` is the translated `typingIndicator.aria.label` (English
21
+ * `'Typing…'`, via `@molecule/app-locales-typing-indicator`); the `ariaLabel`
22
+ * prop overrides it. Each instance injects its own `<style>` tag for the
23
+ * keyframes (fine for a chat view; avoid hundreds at once). Props (documented
24
+ * on the exported `TypingIndicatorProps` interface): visible (default true),
25
+ * dotSize (px, default 6), durationMs (default 1200), ariaLabel, className.
26
26
  *
27
27
  * @module
28
28
  */
package/dist/index.js CHANGED
@@ -17,12 +17,12 @@
17
17
  * @remarks
18
18
  * Dots use `currentColor`, so the indicator inherits the surrounding text
19
19
  * color — wrap it in a muted-text container to dim it. The default
20
- * `ariaLabel` is hardcoded English 'Typing…' (React parity) and there is no
21
- * companion locale bond: pass a translated `ariaLabel` in non-English apps.
22
- * Each instance injects its own `<style>` tag for the keyframes (fine for a
23
- * chat view; avoid hundreds at once). Props (documented on the exported
24
- * `TypingIndicatorProps` interface): visible (default true), dotSize (px,
25
- * default 6), durationMs (default 1200), ariaLabel, className.
20
+ * `ariaLabel` is the translated `typingIndicator.aria.label` (English
21
+ * `'Typing…'`, via `@molecule/app-locales-typing-indicator`); the `ariaLabel`
22
+ * prop overrides it. Each instance injects its own `<style>` tag for the
23
+ * keyframes (fine for a chat view; avoid hundreds at once). Props (documented
24
+ * on the exported `TypingIndicatorProps` interface): visible (default true),
25
+ * dotSize (px, default 6), durationMs (default 1200), ariaLabel, className.
26
26
  *
27
27
  * @module
28
28
  */
package/dist/types.d.ts CHANGED
@@ -11,7 +11,10 @@ export interface TypingIndicatorProps {
11
11
  dotSize?: number;
12
12
  /** Animation duration in ms. Defaults to 1200. */
13
13
  durationMs?: number;
14
- /** Accessible label. */
14
+ /**
15
+ * Accessible label. Overrides the translated / `defaultValue` `'Typing…'`
16
+ * (prop > `t()` > default).
17
+ */
15
18
  ariaLabel?: string;
16
19
  /** Extra classes. */
17
20
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+DAA+D;AAC/D,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,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+DAA+D;AAC/D,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-typing-indicator-solid",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Three-dot animated typing indicator for chat UIs",
5
5
  "homepage": "https://www.molecule.dev/packages/app-typing-indicator-solid",
6
6
  "type": "module",
@@ -51,9 +51,9 @@
51
51
  "@molecule/app-framework-conformance": "0.0.0",
52
52
  "@molecule/app-i18n": "1.2.2",
53
53
  "@molecule/app-icons": "1.0.4",
54
- "@molecule/app-solid": "3.7.1",
55
- "@molecule/app-ui": "1.4.0",
56
- "@molecule/app-ui-solid": "1.1.4",
54
+ "@molecule/app-solid": "3.9.0",
55
+ "@molecule/app-ui": "1.5.0",
56
+ "@molecule/app-ui-solid": "1.2.1",
57
57
  "@types/node": "26.6.5",
58
58
  "jsdom": "30.1.3",
59
59
  "solid-js": "1.9.17",