@ada-cx/lovelace 1.18.1 → 1.18.2

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.
@@ -22,5 +22,8 @@ export interface ScrollMarkerProps extends Omit<AriaButtonProps, "children" | "c
22
22
  * The chat "jump to latest" marker, shown when the user has scrolled up. Renders a
23
23
  * compact down-arrow button, or — once messages arrive below the fold — an unread-count
24
24
  * pill. Selection of icon-only vs with-text is derived from `unreadCount`.
25
+ *
26
+ * The with-text pill takes its accessible name from the visible label. An `aria-label`
27
+ * passed for it must start with that label, so voice-control users can say what they see.
25
28
  */
26
29
  export declare function ScrollMarker({ color, unreadCount, children, className, "aria-label": ariaLabel, ...rest }: ScrollMarkerProps): import("react/jsx-runtime").JSX.Element;
@@ -9,7 +9,7 @@ function s({ color: s = "default", unreadCount: c, children: l, className: u, "a
9
9
  let p = (c ?? 0) >= 1;
10
10
  return /* @__PURE__ */ i(a, {
11
11
  ...f,
12
- "aria-label": d ?? o,
12
+ "aria-label": d ?? (p ? void 0 : o),
13
13
  "data-color": s,
14
14
  "data-type": p ? "with-text" : "icon-only",
15
15
  className: e(n({
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollMarker.js","names":[],"sources":["../../../src/components/ScrollMarker/ScrollMarker.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode, Ref } from \"react\";\nimport type { ButtonProps as AriaButtonProps } from \"react-aria-components\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { cx } from \"../../utils/cx.js\";\nimport { ArrowDown } from \"../Icon/icons/ArrowDown.js\";\nimport { scrollMarkerRoot } from \"./ScrollMarker.css.js\";\n\nexport type ScrollMarkerColor = \"default\" | \"brand\";\n\nexport interface ScrollMarkerProps\n\textends Omit<AriaButtonProps, \"children\" | \"className\" | \"style\"> {\n\t/** `default` sits on the inverse surface; `brand` on the accent surface. */\n\tcolor?: ScrollMarkerColor;\n\t/**\n\t * Unread messages waiting below the fold. `0`/undefined renders the compact\n\t * icon-only marker; `≥1` renders the labelled \"unread\" pill.\n\t */\n\tunreadCount?: number;\n\t/**\n\t * Overrides the with-text label (e.g. a localized \"2 unread\"). When omitted, the\n\t * label defaults to `\"{unreadCount} unread\"`. Rendered only when `unreadCount ≥ 1`.\n\t */\n\tchildren?: ReactNode;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLButtonElement>;\n}\n\nconst DEFAULT_ARIA_LABEL = \"Scroll to latest message\";\n\n/**\n * The chat \"jump to latest\" marker, shown when the user has scrolled up. Renders a\n * compact down-arrow button, or — once messages arrive below the fold — an unread-count\n * pill. Selection of icon-only vs with-text is derived from `unreadCount`.\n */\nexport function ScrollMarker({\n\tcolor = \"default\",\n\tunreadCount,\n\tchildren,\n\tclassName,\n\t\"aria-label\": ariaLabel,\n\t...rest\n}: ScrollMarkerProps) {\n\tconst withText = (unreadCount ?? 0) >= 1;\n\treturn (\n\t\t<AriaButton\n\t\t\t{...rest}\n\t\t\taria-label={ariaLabel ?? DEFAULT_ARIA_LABEL}\n\t\t\tdata-color={color}\n\t\t\tdata-type={withText ? \"with-text\" : \"icon-only\"}\n\t\t\tclassName={cx(\n\t\t\t\tscrollMarkerRoot({ color, type: withText ? \"withText\" : \"iconOnly\" }),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<span>{withText ? (children ?? `${unreadCount} unread`) : \"\"}</span>\n\t\t\t<ArrowDown />\n\t\t</AriaButton>\n\t);\n}\n"],"mappings":";;;;;;AA4BA,IAAM,IAAqB;AAO3B,SAAgB,EAAa,EAC5B,WAAQ,WACR,gBACA,aACA,cACA,cAAc,GACd,GAAG,KACkB;CACrB,IAAM,KAAY,KAAe,MAAM;AACvC,QACC,kBAAC,GAAD;EACC,GAAI;EACJ,cAAY,KAAa;EACzB,cAAY;EACZ,aAAW,IAAW,cAAc;EACpC,WAAW,EACV,EAAiB;GAAE;GAAO,MAAM,IAAW,aAAa;GAAY,CAAC,EACrE,EACA;YARF,CAUC,kBAAC,QAAD,EAAA,UAAO,IAAY,KAAY,GAAG,EAAY,WAAY,IAAU,CAAA,EACpE,kBAAC,GAAD,EAAa,CAAA,CACD"}
1
+ {"version":3,"file":"ScrollMarker.js","names":[],"sources":["../../../src/components/ScrollMarker/ScrollMarker.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode, Ref } from \"react\";\nimport type { ButtonProps as AriaButtonProps } from \"react-aria-components\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { cx } from \"../../utils/cx.js\";\nimport { ArrowDown } from \"../Icon/icons/ArrowDown.js\";\nimport { scrollMarkerRoot } from \"./ScrollMarker.css.js\";\n\nexport type ScrollMarkerColor = \"default\" | \"brand\";\n\nexport interface ScrollMarkerProps\n\textends Omit<AriaButtonProps, \"children\" | \"className\" | \"style\"> {\n\t/** `default` sits on the inverse surface; `brand` on the accent surface. */\n\tcolor?: ScrollMarkerColor;\n\t/**\n\t * Unread messages waiting below the fold. `0`/undefined renders the compact\n\t * icon-only marker; `≥1` renders the labelled \"unread\" pill.\n\t */\n\tunreadCount?: number;\n\t/**\n\t * Overrides the with-text label (e.g. a localized \"2 unread\"). When omitted, the\n\t * label defaults to `\"{unreadCount} unread\"`. Rendered only when `unreadCount ≥ 1`.\n\t */\n\tchildren?: ReactNode;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLButtonElement>;\n}\n\nconst DEFAULT_ARIA_LABEL = \"Scroll to latest message\";\n\n/**\n * The chat \"jump to latest\" marker, shown when the user has scrolled up. Renders a\n * compact down-arrow button, or — once messages arrive below the fold — an unread-count\n * pill. Selection of icon-only vs with-text is derived from `unreadCount`.\n *\n * The with-text pill takes its accessible name from the visible label. An `aria-label`\n * passed for it must start with that label, so voice-control users can say what they see.\n */\nexport function ScrollMarker({\n\tcolor = \"default\",\n\tunreadCount,\n\tchildren,\n\tclassName,\n\t\"aria-label\": ariaLabel,\n\t...rest\n}: ScrollMarkerProps) {\n\tconst withText = (unreadCount ?? 0) >= 1;\n\treturn (\n\t\t<AriaButton\n\t\t\t{...rest}\n\t\t\taria-label={ariaLabel ?? (withText ? undefined : DEFAULT_ARIA_LABEL)}\n\t\t\tdata-color={color}\n\t\t\tdata-type={withText ? \"with-text\" : \"icon-only\"}\n\t\t\tclassName={cx(\n\t\t\t\tscrollMarkerRoot({ color, type: withText ? \"withText\" : \"iconOnly\" }),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<span>{withText ? (children ?? `${unreadCount} unread`) : \"\"}</span>\n\t\t\t<ArrowDown />\n\t\t</AriaButton>\n\t);\n}\n"],"mappings":";;;;;;AA4BA,IAAM,IAAqB;AAU3B,SAAgB,EAAa,EAC5B,WAAQ,WACR,gBACA,aACA,cACA,cAAc,GACd,GAAG,KACkB;CACrB,IAAM,KAAY,KAAe,MAAM;AACvC,QACC,kBAAC,GAAD;EACC,GAAI;EACJ,cAAY,MAAc,IAAW,KAAA,IAAY;EACjD,cAAY;EACZ,aAAW,IAAW,cAAc;EACpC,WAAW,EACV,EAAiB;GAAE;GAAO,MAAM,IAAW,aAAa;GAAY,CAAC,EACrE,EACA;YARF,CAUC,kBAAC,QAAD,EAAA,UAAO,IAAY,KAAY,GAAG,EAAY,WAAY,IAAU,CAAA,EACpE,kBAAC,GAAD,EAAa,CAAA,CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-cx/lovelace",
3
- "version": "1.18.1",
3
+ "version": "1.18.2",
4
4
  "description": "Ada's messaging design system primitives: React Aria Components behavior, vanilla-extract styling, Figma-generated design tokens.",
5
5
  "license": "ISC",
6
6
  "type": "module",