-
Notifications
You must be signed in to change notification settings - Fork 1
Fix Cash Tooltip and Support Link #472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d838a79
40a405d
ecc3d8b
96f4d52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)", | ||
|
|
@@ -265,6 +266,9 @@ const style = { | |
| display: "flex", | ||
| textAlign: "center", | ||
| width: "250px", | ||
| "&::part(body)": { | ||
| pointerEvents: "auto", | ||
| }, | ||
| }, | ||
| ToolTip: { | ||
| top: "6px", | ||
|
|
@@ -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); | ||
|
|
@@ -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); | ||
AndiLuo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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
|
||
| }; | ||
|
|
||
| return ( | ||
| <div> | ||
| <div> | ||
|
|
@@ -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> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.