@momo-webplatform/mobase 0.2.109 → 0.2.111

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.
@@ -140,7 +140,34 @@ interface ActionButtonProps extends ButtonProps {
140
140
  onPushTrackingEvent?: () => void;
141
141
  }
142
142
 
143
- declare const ActionButton: ({ action, newTab, offset, dialogQrProps, className, children, onPushTrackingEvent, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
143
+ /**
144
+ * ActionButton handles different click behaviors based on environment:
145
+ *
146
+ * - MoMo App: action (priority) → qrLink (fallback), via window.open
147
+ * - Desktop (non-app): hasQrLink → DialogQr | no qrLink → action
148
+ * - Mobile (non-app): hasQrLink → navigate to qrLink (unless isQrForAll → DialogQr) | no qrLink → action
149
+ *
150
+ * Supports `asChild` to delegate all action behavior onto a custom child element.
151
+ * When `asChild` is true, Radix Slot is used directly — Button styles are stripped,
152
+ * only the click handler is merged onto the child element.
153
+ *
154
+ * @example
155
+ * // Default usage
156
+ * <ActionButton action="https://...">Click me</ActionButton>
157
+ *
158
+ * @example
159
+ * // asChild — image becomes the clickable element, no Button styles applied
160
+ * <ActionButton asChild action="https://...">
161
+ * <img src="banner.jpg" alt="Banner" />
162
+ * </ActionButton>
163
+ *
164
+ * @example
165
+ * // asChild + QR dialog on desktop
166
+ * <ActionButton asChild dialogQrProps={{ qrLink: "momo://..." }}>
167
+ * <img src="banner.jpg" alt="Banner" />
168
+ * </ActionButton>
169
+ */
170
+ declare const ActionButton: ({ action, newTab, offset, dialogQrProps, className, children, onPushTrackingEvent, asChild, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
144
171
 
145
172
  declare const Breadcrumb: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
146
173
  separator?: React$1.ReactNode;
@@ -140,7 +140,34 @@ interface ActionButtonProps extends ButtonProps {
140
140
  onPushTrackingEvent?: () => void;
141
141
  }
142
142
 
143
- declare const ActionButton: ({ action, newTab, offset, dialogQrProps, className, children, onPushTrackingEvent, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
143
+ /**
144
+ * ActionButton handles different click behaviors based on environment:
145
+ *
146
+ * - MoMo App: action (priority) → qrLink (fallback), via window.open
147
+ * - Desktop (non-app): hasQrLink → DialogQr | no qrLink → action
148
+ * - Mobile (non-app): hasQrLink → navigate to qrLink (unless isQrForAll → DialogQr) | no qrLink → action
149
+ *
150
+ * Supports `asChild` to delegate all action behavior onto a custom child element.
151
+ * When `asChild` is true, Radix Slot is used directly — Button styles are stripped,
152
+ * only the click handler is merged onto the child element.
153
+ *
154
+ * @example
155
+ * // Default usage
156
+ * <ActionButton action="https://...">Click me</ActionButton>
157
+ *
158
+ * @example
159
+ * // asChild — image becomes the clickable element, no Button styles applied
160
+ * <ActionButton asChild action="https://...">
161
+ * <img src="banner.jpg" alt="Banner" />
162
+ * </ActionButton>
163
+ *
164
+ * @example
165
+ * // asChild + QR dialog on desktop
166
+ * <ActionButton asChild dialogQrProps={{ qrLink: "momo://..." }}>
167
+ * <img src="banner.jpg" alt="Banner" />
168
+ * </ActionButton>
169
+ */
170
+ declare const ActionButton: ({ action, newTab, offset, dialogQrProps, className, children, onPushTrackingEvent, asChild, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
144
171
 
145
172
  declare const Breadcrumb: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
146
173
  separator?: React$1.ReactNode;