Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/mint-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.7] - 2025-12-09

- \<sqm-tax-and-cash-dashboard-view>

- Replaced sl-tooltip with custom sl-dropdown to handle clickable tooltip content
- Added ICU string for text prop indirectTaxTooltipSupport

- \<sqm-tax-and-cash-dashboard>

- Updated text prop indirectTaxTooltipSupport to handle ICU string

## [2.0.6] - 2025-12-05

### Changed
Expand Down Expand Up @@ -1439,7 +1450,8 @@ This major release represents a significant advancement in the theming capabilit
- \<sqm-popup-container>
- \<sqm-stencilbook>

[unreleased]: https://github.com/saasquatch/program-tools/compare/[email protected]
[unreleased]: https://github.com/saasquatch/program-tools/compare/[email protected]
[2.0.7]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%402.0.7
[2.0.6]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%402.0.6
[2.0.5]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%402.0.5
[2.0.4]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%402.0.4
Expand Down
4 changes: 2 additions & 2 deletions packages/mint-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/mint-components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@saasquatch/mint-components",
"title": "Mint Components",
"version": "2.0.6",
"version": "2.0.7",
"description": "A minimal design library with components for referral and loyalty experiences. Built with Shoelace components by Saasquatch.",
"icon": "https://res.cloudinary.com/saasquatch/image/upload/v1652219900/squatch-assets/For_Mint.svg",
"raisins": "docs/raisins.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
| `indirectTaxInfoOtherCountry` | `indirect-tax-info-other-country` | If the participant is registered for indirect tax, display the country they’re registered in. | `string` | `"Registered in {country}"` |
| `indirectTaxInfoSectionHeader` | `indirect-tax-info-section-header` | | `string` | `"Indirect tax"` |
| `indirectTaxInfoSpain` | `indirect-tax-info-spain` | If the participant is registered for indirect tax in Spain, display the region they’re registered in. | `string` | `"Registered in {country}, {subRegion}"` |
| `indirectTaxTooltipSupport` | `indirect-tax-tooltip-support` | | `string` | `"To make changes to your indirect tax information, please contact our Support team."` |
| `indirectTaxTooltipSupport` | `indirect-tax-tooltip-support` | | `string` | `"To make changes to your indirect tax information, please contact our {supportLink}."` |
| `invalidForm` | `invalid-form` | Additional text displayed next to the tax form's status badge. | `string` | `"Make sure your information is correct and submit new form."` |
| `invoiceColumnTitle` | `invoice-column-title` | Part of the Invoice table displayed at the bottom of the page. | `string` | `"Invoice"` |
| `invoiceDescription` | `invoice-description` | | `string` | `"View and download your invoices to report your earnings and stay tax compliant."` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ const style = {
marginBottom: "var(--sl-spacing-xx-small)",
margin: "0",
display: "flex",
alignItems: "center",
gap: "var(--sl-spacing-x-small)",
"&::part(base)": {
color: "var(--sqm-text)",
Expand Down Expand Up @@ -265,6 +266,9 @@ const style = {
display: "flex",
textAlign: "center",
width: "250px",
"&::part(body)": {
pointerEvents: "auto",
},
},
ToolTip: {
top: "6px",
Expand Down Expand Up @@ -344,6 +348,43 @@ const style = {
gap: "var(--sl-spacing-medium)",
flexWrap: "wrap",
},
DropdownTooltipContainer: {
top: "-4px",
"&::part(panel)": {
boxShadow: "none",
border: "none",
marginTop: "var(--sl-spacing-x-small)",
},
},
DropdownContent: {
padding: "var(--sl-spacing-xxx-small) var(--sl-spacing-x-small)",
fontSize: "var(--sl-font-size-small)",
fontFamily: "var(--sl-font-sans)",
fontWeight: "var(--sl-font-weight-normal)",
lineHeight: "var(--sl-line-height-dense)",
minWidth: "225px",
backgroundColor: "var(--sl-color-gray-900)",
color: "var(--sl-color-white)",
borderRadius: "var(--sl-border-radius-medium)",
position: "relative",
marginLeft: "5px",
},
DropdownArrow: {
position: "absolute",
left: "-5px",
top: "50%",
transform: "translateY(-50%)",
width: "0",
height: "0",
borderTop: "5px solid transparent",
borderBottom: "5px solid transparent",
borderRight: "5px solid var(--sl-color-gray-900)",
zIndex: "1",
},
DropdownLink: {
color: "var(--sl-color-white)",
textDecoration: "underline",
},
};

const sheet = createStyleSheet(style);
Expand Down Expand Up @@ -909,6 +950,39 @@ export const TaxAndCashDashboardView = (props: TaxAndCashDashboardProps) => {

const alertInfo = getAlert(states.payoutStatus);

const dropdownHover = (el) => {
if (!el) return;

const trigger = el.querySelector('[slot="trigger"]');
const panel = el.shadowRoot?.querySelector(".dropdown__panel");

if (!trigger || !panel) return;

let hideTimeout: ReturnType<typeof setTimeout> | undefined;

const show = () => {
clearTimeout(hideTimeout);
el.show();
};

const scheduleHide = () => {
hideTimeout = setTimeout(() => el.hide(), 100);
};

trigger.addEventListener("mouseenter", show);
trigger.addEventListener("mouseleave", scheduleHide);
panel.addEventListener("mouseenter", show);
panel.addEventListener("mouseleave", scheduleHide);

return () => {
trigger.removeEventListener("mouseenter", show);
trigger.removeEventListener("mouseleave", scheduleHide);
panel.removeEventListener("mouseenter", show);
panel.removeEventListener("mouseleave", scheduleHide);
clearTimeout(hideTimeout);
};
Comment on lines +977 to +983
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dropdownHover function returns a cleanup function but nothing calls it, leading to event listener leaks. This cleanup function should be called when the component is unmounted or the ref changes. Consider using this return value in a useEffect or similar cleanup mechanism.

Copilot uses AI. Check for mistakes.
};

return (
<div>
<div>
Expand Down Expand Up @@ -1108,14 +1182,39 @@ export const TaxAndCashDashboardView = (props: TaxAndCashDashboardProps) => {
<div>
<h3 class={sheet.classes.IndirectTaxPreviewHeaderContainer}>
{text.indirectTaxInfoSectionHeader}
<sl-tooltip
trigger="hover"
<sl-dropdown
placement="right"
content={text.indirectTaxTooltipSupport}
class={sheet.classes.TooltipContainer}
distance={1}
ref={dropdownHover}
class={sheet.classes.DropdownTooltipContainer}
>
<sl-icon name="info-circle" class={sheet.classes.ToolTip} />
</sl-tooltip>
<sl-icon
slot="trigger"
name="info-circle"
class={sheet.classes.ToolTip}
style={{ cursor: "pointer" }}
/>
<div class={sheet.classes.DropdownContent}>
<div class={sheet.classes.DropdownArrow}></div>
{intl.formatMessage(
{
id: "indirectTaxTooltipSupport",
defaultMessage: text.indirectTaxTooltipSupport,
},
{
supportLink: (
<a
target="_blank"
href={`mailto:[email protected]`}
class={sheet.classes.DropdownLink}
>
{text.supportLink}
</a>
),
}
)}
</div>
</sl-dropdown>
</h3>
<div class={sheet.classes.IndirectTaxPreviewDetails}>
<span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class TaxAndCashDashboard {
* @uiWidget textArea
*/
@Prop() indirectTaxTooltipSupport: string =
"To make changes to your indirect tax information, please contact our Support team.";
"To make changes to your indirect tax information, please contact our {supportLink}.";
/**
* Displayed to participants who have submitted their indirect tax information.
*
Expand Down
Loading