@ada-cx/lovelace 1.2.0 → 1.3.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.
@@ -16,11 +16,7 @@ function s({ color: s = "default", unreadCount: c, children: l, className: u, "a
16
16
  color: s,
17
17
  type: p ? "withText" : "iconOnly"
18
18
  }), u),
19
- children: [/* @__PURE__ */ r("span", {
20
- "aria-live": "polite",
21
- "aria-atomic": "true",
22
- children: p ? l ?? `${c} unread` : ""
23
- }), /* @__PURE__ */ r(t, {})]
19
+ children: [/* @__PURE__ */ r("span", { children: p ? l ?? `${c} unread` : "" }), /* @__PURE__ */ r(t, {})]
24
20
  });
25
21
  }
26
22
  //#endregion
@@ -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 aria-live=\"polite\" aria-atomic=\"true\">\n\t\t\t\t{withText ? (children ?? `${unreadCount} unread`) : \"\"}\n\t\t\t</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;GAAM,aAAU;GAAS,eAAY;aACnC,IAAY,KAAY,GAAG,EAAY,WAAY;GAC9C,CAAA,EACP,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 */\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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-cx/lovelace",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
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",