@snacky/ui 0.13.2 → 0.13.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,35 @@ How `@snacky/ui` got to its current state. The README documents what the
4
4
  package *is*; this documents how it got there, including the mistakes, so the
5
5
  verification claims in the README can be taken at face value.
6
6
 
7
+ ## Icons and affordances the spec owns, not the caller (0.13.3)
8
+
9
+ `0.13.2` gave `SearchField`'s magnifier a real default and noted the rule: an
10
+ image slot is caller-owned because this package ships no photography, but an
11
+ icon slot belongs to the component's own spec and has to fall back to the icon
12
+ set. Rendering all 26 components at once in a real app turned up three more
13
+ slots that had never been audited against it, each checked here against its own
14
+ Figma-exported variant PNG:
15
+
16
+ - `AddressResult` rendered no map pin unless `icon` was passed. It now defaults
17
+ to `outline.address` at 20px, which is what `input-address-search-selected.png`
18
+ shows and what the docs sample always passed.
19
+ - `PointBalanceBanner` rendered neither of its two glyphs. `pointsIcon` and
20
+ `balanceIcon` were required props, so TypeScript at least caught an omission,
21
+ but there was no reason for a caller to supply artwork the component's own
22
+ Figma node draws. Both are optional now and default to `solid.points` and
23
+ `solid.balance` at 16px, already tinted `--icon-brand` by the CSS.
24
+ - `SearchField`'s clear button was gated on `value && onClear`, so a caller who
25
+ wired up only `value`/`onChange` got a filled field with no way to empty it, a
26
+ state Figma does not have (its filled variant always draws the button). The
27
+ text alone drives it now, and it falls back to `onChange('')`. Same rule
28
+ applied to behaviour rather than artwork: an optional prop that gates part of
29
+ the spec is a missing default, whatever it carries.
30
+
31
+ The compose-ui counterpart of all three shipped as `compose-v2.3.7`, which also
32
+ gives its `SnackyPasswordField` a real eye toggle. React has no `PasswordField`
33
+ component (password is `<TextField type="password" trailingIcon={...} />`, as
34
+ Figma models it), so there is nothing matching to fix here.
35
+
7
36
  ## ProductGroupSection, and a mouse-draggable product row (0.13.0)
8
37
 
9
38
  `ProductGroupSection` is a titled group of list `ProductCard`s with
package/dist/index.cjs CHANGED
@@ -456,7 +456,16 @@ var SearchField = (0, import_react5.forwardRef)(function SearchField2({ value, o
456
456
  ...rest
457
457
  }
458
458
  ),
459
- value && onClear && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "snacky-search__clear", onClick: onClear, "aria-label": "Clear search", children: clearIcon ?? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(closeInput, { width: 16, height: 16 }) })
459
+ value && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
460
+ "button",
461
+ {
462
+ type: "button",
463
+ className: "snacky-search__clear",
464
+ onClick: onClear ?? (() => onChange("")),
465
+ "aria-label": "Clear search",
466
+ children: clearIcon ?? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(closeInput, { width: 16, height: 16 })
467
+ }
468
+ )
460
469
  ] });
461
470
  });
462
471
 
@@ -549,7 +558,7 @@ function ChatInput({ value, onChange, onSend, sendIcon, className, placeholder =
549
558
  var import_jsx_runtime10 = require("react/jsx-runtime");
550
559
  function AddressResult({ icon: icon3, title, subtitle, onClick, className }) {
551
560
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: cx("snacky-address-result", className), onClick, children: [
552
- icon3 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "snacky-address-result__icon", children: icon3 }),
561
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "snacky-address-result__icon", children: icon3 ?? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(address, { width: 20, height: 20 }) }),
553
562
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
554
563
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "snacky-address-result__title", children: title }),
555
564
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "snacky-address-result__subtitle", children: subtitle })
@@ -820,7 +829,7 @@ function FullWidthBanner({ imageUrl, alt, onClick, className }) {
820
829
  function PointBalanceBanner({ pointsIcon, points: points2, balanceIcon, balance: balance3, className }) {
821
830
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cx("snacky-banner-point-balance", className), children: [
822
831
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "snacky-banner-point-balance__item", children: [
823
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "snacky-banner-point-balance__icon", children: pointsIcon }),
832
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "snacky-banner-point-balance__icon", children: pointsIcon ?? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(points, { width: 16, height: 16 }) }),
824
833
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
825
834
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "snacky-banner-point-balance__label", children: "Points" }),
826
835
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "snacky-banner-point-balance__value", children: points2 })
@@ -828,7 +837,7 @@ function PointBalanceBanner({ pointsIcon, points: points2, balanceIcon, balance:
828
837
  ] }),
829
838
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "snacky-banner-point-balance__divider" }),
830
839
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "snacky-banner-point-balance__item", children: [
831
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "snacky-banner-point-balance__icon", children: balanceIcon }),
840
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "snacky-banner-point-balance__icon", children: balanceIcon ?? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(balance2, { width: 16, height: 16 }) }),
832
841
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
833
842
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "snacky-banner-point-balance__label", children: "Balance" }),
834
843
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "snacky-banner-point-balance__value", children: balance3 })