@lucynam/fashiongo-ui 0.2.7 → 0.2.8

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.mts CHANGED
@@ -373,23 +373,25 @@ declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefA
373
373
  /**
374
374
  * PDP CTA Button — "Add to Bag" with FashionGo-specific states.
375
375
  *
376
- * Figma: pc_components > PDP_CTA (node 1:4561)
376
+ * Figma: node 7:130096
377
377
  *
378
378
  * Variants match Figma property1:
379
- * default → "1" — black bg, white text, Add to Bag + price
380
- * hover → "1_hover" — darker black on hover (CSS :hover handles it)
381
- * loading → "2" — gray bg, spinner
382
- * complete → "3" — black bg, checkmark + "Added to Bag!"
383
- * outline → "line" — bordered, transparent bg
379
+ * default → "1" — black bg, white text, [icon] "Add to Bag" · price
380
+ * loading → "2" — gray bg, spinner only
381
+ * complete → "3" — black bg, [icon] [bullet] "Add to Bag" (no price)
382
+ * outline → "line" — bordered, transparent bg, dark text
384
383
  * disabled → "disable" — 8% black bg, quaternary text
384
+ * link → "Link" — no bg, dark text, inline link style
385
385
  */
386
- type PdpCtaVariant = "default" | "loading" | "complete" | "outline" | "disabled";
386
+ type PdpCtaVariant = "default" | "loading" | "complete" | "outline" | "disabled" | "link";
387
387
  interface PdpCtaProps {
388
388
  variant?: PdpCtaVariant;
389
389
  label?: string;
390
390
  price?: string;
391
- /** Custom icon for the bullet/check (16×16 img or SVG element) */
391
+ /** Left icon — 20×20 brand logo or similar (shown in default/complete/outline/disabled/link) */
392
392
  icon?: React.ReactNode;
393
+ /** Bullet icon shown between icon and label in "complete" variant (16×16) */
394
+ bullet?: React.ReactNode;
393
395
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
394
396
  className?: string;
395
397
  }
package/dist/index.d.ts CHANGED
@@ -373,23 +373,25 @@ declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefA
373
373
  /**
374
374
  * PDP CTA Button — "Add to Bag" with FashionGo-specific states.
375
375
  *
376
- * Figma: pc_components > PDP_CTA (node 1:4561)
376
+ * Figma: node 7:130096
377
377
  *
378
378
  * Variants match Figma property1:
379
- * default → "1" — black bg, white text, Add to Bag + price
380
- * hover → "1_hover" — darker black on hover (CSS :hover handles it)
381
- * loading → "2" — gray bg, spinner
382
- * complete → "3" — black bg, checkmark + "Added to Bag!"
383
- * outline → "line" — bordered, transparent bg
379
+ * default → "1" — black bg, white text, [icon] "Add to Bag" · price
380
+ * loading → "2" — gray bg, spinner only
381
+ * complete → "3" — black bg, [icon] [bullet] "Add to Bag" (no price)
382
+ * outline → "line" — bordered, transparent bg, dark text
384
383
  * disabled → "disable" — 8% black bg, quaternary text
384
+ * link → "Link" — no bg, dark text, inline link style
385
385
  */
386
- type PdpCtaVariant = "default" | "loading" | "complete" | "outline" | "disabled";
386
+ type PdpCtaVariant = "default" | "loading" | "complete" | "outline" | "disabled" | "link";
387
387
  interface PdpCtaProps {
388
388
  variant?: PdpCtaVariant;
389
389
  label?: string;
390
390
  price?: string;
391
- /** Custom icon for the bullet/check (16×16 img or SVG element) */
391
+ /** Left icon — 20×20 brand logo or similar (shown in default/complete/outline/disabled/link) */
392
392
  icon?: React.ReactNode;
393
+ /** Bullet icon shown between icon and label in "complete" variant (16×16) */
394
+ bullet?: React.ReactNode;
393
395
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
394
396
  className?: string;
395
397
  }
package/dist/index.js CHANGED
@@ -753,12 +753,15 @@ var PdpCta_default = {
753
753
  "variant-complete": "PdpCta_variant-complete",
754
754
  "variant-outline": "PdpCta_variant-outline",
755
755
  "variant-disabled": "PdpCta_variant-disabled",
756
+ "variant-link": "PdpCta_variant-link",
756
757
  label: "PdpCta_label",
757
758
  "label-white": "PdpCta_label-white",
758
759
  "label-disabled": "PdpCta_label-disabled",
759
- icon: "PdpCta_icon",
760
+ separator: "PdpCta_separator",
761
+ iconWrap: "PdpCta_iconWrap",
762
+ bulletWrap: "PdpCta_bulletWrap",
760
763
  spinner: "PdpCta_spinner",
761
- spin: "PdpCta_spin"
764
+ pdpCtaSpin: "PdpCta_pdpCtaSpin"
762
765
  };
763
766
 
764
767
  // src/components/PdpCta/PdpCta.tsx
@@ -769,34 +772,63 @@ var PdpCta = import_react11.default.forwardRef(
769
772
  label = "Add to Bag",
770
773
  price,
771
774
  icon,
775
+ bullet,
772
776
  onClick,
773
777
  className
774
778
  }, ref) => {
775
- const isDisabled = variant === "disabled" || variant === "loading";
776
- const classes = [
779
+ const rootClass = [
777
780
  PdpCta_default.cta,
778
781
  PdpCta_default[`variant-${variant}`],
779
- className ?? ""
782
+ className
780
783
  ].filter(Boolean).join(" ");
781
784
  if (variant === "loading") {
782
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: classes, "aria-label": "Loading", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.spinner, "aria-hidden": "true" }) });
785
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: rootClass, role: "status", "aria-label": "Loading", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.spinner, "aria-hidden": "true" }) });
783
786
  }
784
- const labelColorClass = variant === "disabled" ? PdpCta_default["label-disabled"] : PdpCta_default["label-white"];
787
+ const isDisabled = variant === "disabled";
788
+ const isWhiteText = variant === "default" || variant === "complete";
789
+ const labelClass = [
790
+ PdpCta_default.label,
791
+ isWhiteText ? PdpCta_default["label-white"] : "",
792
+ isDisabled ? PdpCta_default["label-disabled"] : ""
793
+ ].filter(Boolean).join(" ");
785
794
  if (variant === "complete") {
786
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: classes, children: [
787
- icon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.icon, "aria-hidden": "true", children: icon }),
788
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: `${PdpCta_default.label} ${PdpCta_default["label-white"]}`, children: label })
795
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: rootClass, children: [
796
+ icon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.iconWrap, "aria-hidden": "true", children: icon }),
797
+ bullet && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.bulletWrap, "aria-hidden": "true", children: bullet }),
798
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: labelClass, children: label })
789
799
  ] });
790
800
  }
801
+ if (variant === "link") {
802
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
803
+ "button",
804
+ {
805
+ ref,
806
+ className: rootClass,
807
+ onClick,
808
+ type: "button",
809
+ children: [
810
+ icon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.iconWrap, "aria-hidden": "true", children: icon }),
811
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.label, children: label }),
812
+ price && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
813
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.separator, "aria-hidden": "true", children: "\xB7" }),
814
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.label, children: price })
815
+ ] })
816
+ ]
817
+ }
818
+ );
819
+ }
791
820
  if (variant === "outline") {
792
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
821
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
793
822
  "button",
794
823
  {
795
824
  ref,
796
- className: classes,
825
+ className: rootClass,
797
826
  onClick,
798
827
  type: "button",
799
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: `${PdpCta_default.label}`, style: { color: "var(--fg-text-primary)" }, children: label })
828
+ children: [
829
+ icon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.iconWrap, "aria-hidden": "true", children: icon }),
830
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.label, children: label })
831
+ ]
800
832
  }
801
833
  );
802
834
  }
@@ -804,14 +836,17 @@ var PdpCta = import_react11.default.forwardRef(
804
836
  "button",
805
837
  {
806
838
  ref,
807
- className: classes,
839
+ className: rootClass,
808
840
  onClick,
809
841
  disabled: isDisabled,
810
842
  type: "button",
811
843
  children: [
812
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: `${PdpCta_default.label} ${labelColorClass}`, children: label }),
813
- icon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.icon, "aria-hidden": "true", children: icon }),
814
- price && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: `${PdpCta_default.label} ${labelColorClass}`, children: price })
844
+ icon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: PdpCta_default.iconWrap, "aria-hidden": "true", children: icon }),
845
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: labelClass, children: label }),
846
+ price && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
847
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: [PdpCta_default.separator, isWhiteText ? PdpCta_default["label-white"] : "", isDisabled ? PdpCta_default["label-disabled"] : ""].filter(Boolean).join(" "), "aria-hidden": "true", children: "\xB7" }),
848
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: labelClass, children: price })
849
+ ] })
815
850
  ]
816
851
  }
817
852
  );