@momo-webplatform/mobase 1.0.7 → 1.0.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.
@@ -125,9 +125,37 @@ interface ActionButtonProps extends ButtonProps {
125
125
  * The content for button.
126
126
  */
127
127
  children?: ReactNode;
128
+ onPushTrackingEvent?: () => void;
128
129
  }
129
130
 
130
- declare const ActionButton: ({ action, newTab, offset, dialogQrProps, className, children, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
131
+ /**
132
+ * ActionButton handles different click behaviors based on environment:
133
+ *
134
+ * - MoMo App: action (priority) → qrLink (fallback), via window.open
135
+ * - Desktop (non-app): hasQrLink → DialogQr | no qrLink → action
136
+ * - Mobile (non-app): hasQrLink → navigate to qrLink (unless isQrForAll → DialogQr) | no qrLink → action
137
+ *
138
+ * Supports `asChild` to delegate all action behavior onto a custom child element.
139
+ * When `asChild` is true, Radix Slot is used directly — Button styles are stripped,
140
+ * only the click handler is merged onto the child element.
141
+ *
142
+ * @example
143
+ * // Default usage
144
+ * <ActionButton action="https://...">Click me</ActionButton>
145
+ *
146
+ * @example
147
+ * // asChild — image becomes the clickable element, no Button styles applied
148
+ * <ActionButton asChild action="https://...">
149
+ * <img src="banner.jpg" alt="Banner" />
150
+ * </ActionButton>
151
+ *
152
+ * @example
153
+ * // asChild + QR dialog on desktop
154
+ * <ActionButton asChild dialogQrProps={{ qrLink: "momo://..." }}>
155
+ * <img src="banner.jpg" alt="Banner" />
156
+ * </ActionButton>
157
+ */
158
+ declare const ActionButton: ({ action, newTab, offset, dialogQrProps, className, children, onPushTrackingEvent, asChild, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
131
159
 
132
160
  declare const Breadcrumb: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
133
161
  separator?: React$1.ReactNode;
@@ -125,9 +125,37 @@ interface ActionButtonProps extends ButtonProps {
125
125
  * The content for button.
126
126
  */
127
127
  children?: ReactNode;
128
+ onPushTrackingEvent?: () => void;
128
129
  }
129
130
 
130
- declare const ActionButton: ({ action, newTab, offset, dialogQrProps, className, children, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
131
+ /**
132
+ * ActionButton handles different click behaviors based on environment:
133
+ *
134
+ * - MoMo App: action (priority) → qrLink (fallback), via window.open
135
+ * - Desktop (non-app): hasQrLink → DialogQr | no qrLink → action
136
+ * - Mobile (non-app): hasQrLink → navigate to qrLink (unless isQrForAll → DialogQr) | no qrLink → action
137
+ *
138
+ * Supports `asChild` to delegate all action behavior onto a custom child element.
139
+ * When `asChild` is true, Radix Slot is used directly — Button styles are stripped,
140
+ * only the click handler is merged onto the child element.
141
+ *
142
+ * @example
143
+ * // Default usage
144
+ * <ActionButton action="https://...">Click me</ActionButton>
145
+ *
146
+ * @example
147
+ * // asChild — image becomes the clickable element, no Button styles applied
148
+ * <ActionButton asChild action="https://...">
149
+ * <img src="banner.jpg" alt="Banner" />
150
+ * </ActionButton>
151
+ *
152
+ * @example
153
+ * // asChild + QR dialog on desktop
154
+ * <ActionButton asChild dialogQrProps={{ qrLink: "momo://..." }}>
155
+ * <img src="banner.jpg" alt="Banner" />
156
+ * </ActionButton>
157
+ */
158
+ declare const ActionButton: ({ action, newTab, offset, dialogQrProps, className, children, onPushTrackingEvent, asChild, ...props }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
131
159
 
132
160
  declare const Breadcrumb: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
133
161
  separator?: React$1.ReactNode;