@snacky/ui 0.13.1 → 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/dist/index.d.cts CHANGED
@@ -72,6 +72,7 @@ interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, '
72
72
  value: string;
73
73
  onChange: (value: string) => void;
74
74
  searchIcon?: ReactNode;
75
+ clearIcon?: ReactNode;
75
76
  onClear?: () => void;
76
77
  }
77
78
  /** Snacky Search Field - compact 40px field with a leading search icon and a clear button once filled. */
@@ -214,9 +215,9 @@ declare function SquareBanner({ imageUrl, alt, onClick, className }: ImageBanner
214
215
  /** Snacky Full-width Banner - prominent promotional banner on detail pages. */
215
216
  declare function FullWidthBanner({ imageUrl, alt, onClick, className }: ImageBannerProps): react.JSX.Element;
216
217
  interface PointBalanceBannerProps {
217
- pointsIcon: ReactNode;
218
+ pointsIcon?: ReactNode;
218
219
  points: string;
219
- balanceIcon: ReactNode;
220
+ balanceIcon?: ReactNode;
220
221
  balance: string;
221
222
  className?: string;
222
223
  }
package/dist/index.d.ts CHANGED
@@ -72,6 +72,7 @@ interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, '
72
72
  value: string;
73
73
  onChange: (value: string) => void;
74
74
  searchIcon?: ReactNode;
75
+ clearIcon?: ReactNode;
75
76
  onClear?: () => void;
76
77
  }
77
78
  /** Snacky Search Field - compact 40px field with a leading search icon and a clear button once filled. */
@@ -214,9 +215,9 @@ declare function SquareBanner({ imageUrl, alt, onClick, className }: ImageBanner
214
215
  /** Snacky Full-width Banner - prominent promotional banner on detail pages. */
215
216
  declare function FullWidthBanner({ imageUrl, alt, onClick, className }: ImageBannerProps): react.JSX.Element;
216
217
  interface PointBalanceBannerProps {
217
- pointsIcon: ReactNode;
218
+ pointsIcon?: ReactNode;
218
219
  points: string;
219
- balanceIcon: ReactNode;
220
+ balanceIcon?: ReactNode;
220
221
  balance: string;
221
222
  className?: string;
222
223
  }
package/dist/index.js CHANGED
@@ -379,9 +379,9 @@ var TextField = forwardRef4(function TextField2({
379
379
  // src/components/Input/SearchField.tsx
380
380
  import { forwardRef as forwardRef5 } from "react";
381
381
  import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
382
- var SearchField = forwardRef5(function SearchField2({ value, onChange, searchIcon, onClear, className, placeholder = "Search products...", ...rest }, ref) {
382
+ var SearchField = forwardRef5(function SearchField2({ value, onChange, searchIcon, clearIcon, onClear, className, placeholder = "Search products...", ...rest }, ref) {
383
383
  return /* @__PURE__ */ jsxs3("div", { className: cx("snacky-search", className), children: [
384
- searchIcon && /* @__PURE__ */ jsx6("span", { className: "snacky-search__icon", children: searchIcon }),
384
+ /* @__PURE__ */ jsx6("span", { className: "snacky-search__icon", children: searchIcon ?? /* @__PURE__ */ jsx6(search, { width: 16, height: 16 }) }),
385
385
  /* @__PURE__ */ jsx6(
386
386
  "input",
387
387
  {
@@ -393,7 +393,16 @@ var SearchField = forwardRef5(function SearchField2({ value, onChange, searchIco
393
393
  ...rest
394
394
  }
395
395
  ),
396
- value && onClear && /* @__PURE__ */ jsx6("button", { type: "button", className: "snacky-search__clear", onClick: onClear, "aria-label": "Clear search", children: "\u2715" })
396
+ value && /* @__PURE__ */ jsx6(
397
+ "button",
398
+ {
399
+ type: "button",
400
+ className: "snacky-search__clear",
401
+ onClick: onClear ?? (() => onChange("")),
402
+ "aria-label": "Clear search",
403
+ children: clearIcon ?? /* @__PURE__ */ jsx6(closeInput, { width: 16, height: 16 })
404
+ }
405
+ )
397
406
  ] });
398
407
  });
399
408
 
@@ -486,7 +495,7 @@ function ChatInput({ value, onChange, onSend, sendIcon, className, placeholder =
486
495
  import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
487
496
  function AddressResult({ icon: icon3, title, subtitle, onClick, className }) {
488
497
  return /* @__PURE__ */ jsxs6("button", { type: "button", className: cx("snacky-address-result", className), onClick, children: [
489
- icon3 && /* @__PURE__ */ jsx10("span", { className: "snacky-address-result__icon", children: icon3 }),
498
+ /* @__PURE__ */ jsx10("span", { className: "snacky-address-result__icon", children: icon3 ?? /* @__PURE__ */ jsx10(address, { width: 20, height: 20 }) }),
490
499
  /* @__PURE__ */ jsxs6("span", { children: [
491
500
  /* @__PURE__ */ jsx10("p", { className: "snacky-address-result__title", children: title }),
492
501
  /* @__PURE__ */ jsx10("p", { className: "snacky-address-result__subtitle", children: subtitle })
@@ -757,7 +766,7 @@ function FullWidthBanner({ imageUrl, alt, onClick, className }) {
757
766
  function PointBalanceBanner({ pointsIcon, points: points2, balanceIcon, balance: balance3, className }) {
758
767
  return /* @__PURE__ */ jsxs13("div", { className: cx("snacky-banner-point-balance", className), children: [
759
768
  /* @__PURE__ */ jsxs13("div", { className: "snacky-banner-point-balance__item", children: [
760
- /* @__PURE__ */ jsx20("span", { className: "snacky-banner-point-balance__icon", children: pointsIcon }),
769
+ /* @__PURE__ */ jsx20("span", { className: "snacky-banner-point-balance__icon", children: pointsIcon ?? /* @__PURE__ */ jsx20(points, { width: 16, height: 16 }) }),
761
770
  /* @__PURE__ */ jsxs13("div", { children: [
762
771
  /* @__PURE__ */ jsx20("p", { className: "snacky-banner-point-balance__label", children: "Points" }),
763
772
  /* @__PURE__ */ jsx20("p", { className: "snacky-banner-point-balance__value", children: points2 })
@@ -765,7 +774,7 @@ function PointBalanceBanner({ pointsIcon, points: points2, balanceIcon, balance:
765
774
  ] }),
766
775
  /* @__PURE__ */ jsx20("div", { className: "snacky-banner-point-balance__divider" }),
767
776
  /* @__PURE__ */ jsxs13("div", { className: "snacky-banner-point-balance__item", children: [
768
- /* @__PURE__ */ jsx20("span", { className: "snacky-banner-point-balance__icon", children: balanceIcon }),
777
+ /* @__PURE__ */ jsx20("span", { className: "snacky-banner-point-balance__icon", children: balanceIcon ?? /* @__PURE__ */ jsx20(balance2, { width: 16, height: 16 }) }),
769
778
  /* @__PURE__ */ jsxs13("div", { children: [
770
779
  /* @__PURE__ */ jsx20("p", { className: "snacky-banner-point-balance__label", children: "Balance" }),
771
780
  /* @__PURE__ */ jsx20("p", { className: "snacky-banner-point-balance__value", children: balance3 })