@internetarchive/elements 1.11.0-webdev-9043.0 → 2.0.0-webdev-9043.0

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.
Files changed (28) hide show
  1. package/dist/src/elements/ia-button/ia-button.d.ts.map +1 -1
  2. package/dist/src/elements/ia-button/ia-button.js +6 -1
  3. package/dist/src/elements/ia-button/ia-button.js.map +1 -1
  4. package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.d.ts.map +1 -1
  5. package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js +19 -5
  6. package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js.map +1 -1
  7. package/dist/src/elements/ia-donation-form/ia-donation-form.js +3 -3
  8. package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +1 -1
  9. package/dist/src/elements/ia-dropdown/ia-dropdown.d.ts.map +1 -1
  10. package/dist/src/elements/ia-dropdown/ia-dropdown.js +7 -0
  11. package/dist/src/elements/ia-dropdown/ia-dropdown.js.map +1 -1
  12. package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.d.ts.map +1 -1
  13. package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js +0 -1
  14. package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js.map +1 -1
  15. package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js +1 -1
  16. package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js.map +1 -1
  17. package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js +1 -1
  18. package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js.map +1 -1
  19. package/dist/src/elements/ia-playback-controls/ia-playback-controls.js +2 -2
  20. package/dist/src/elements/ia-playback-controls/ia-playback-controls.js.map +1 -1
  21. package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js +1 -1
  22. package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js.map +1 -1
  23. package/dist/src/elements/ia-topnav/ia-topnav.js +3 -3
  24. package/dist/src/elements/ia-topnav/ia-topnav.js.map +1 -1
  25. package/dist/src/themes/unit.d.ts.map +1 -1
  26. package/dist/src/themes/unit.js +3 -1
  27. package/dist/src/themes/unit.js.map +1 -1
  28. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ia-button.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-button/ia-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,cAAc,EACd,cAAc,EAEd,cAAc,EAEf,MAAM,KAAK,CAAC;AAMb,OAAO,4CAA4C,CAAC;AAIpD;;;;;;;;;;;;;GAaG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC;;;;OAIG;IACyB,IAAI,EAC5B,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,OAAO,GACP,aAAa,GACb,QAAQ,GACR,MAAM,GACN,aAAa,CAAa;IAGF,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAG/B,OAAO,EAAE,OAAO,CAAS;IAGzB,QAAQ,EAAE,OAAO,CAAS;IAG3B,WAAW,EAAE,MAAM,CAAM;IAGV,IAAI,EAC3C,QAAQ,GACR,QAAQ,GACR,OAAO,CAAY;IAGK,IAAI,CAAC,EAAE,MAAM,CAAC;IAGb,eAAe,EAAE,OAAO,CAAS;IAE9D,MAAM,IAAI,cAAc;IAQxB,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAsBnD,OAAO,KAAK,QAAQ,GAEnB;IAGD,OAAO,KAAK,OAAO,GAWlB;IAGD,OAAO,KAAK,cAAc,GAUzB;IAGD,OAAO,KAAK,YAAY,GAYvB;IAMD,OAAO,KAAK,eAAe,GAK1B;IAGD,OAAO,KAAK,oBAAoB,GAO/B;IAED;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAIzB;IAEF,yDAAyD;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ACzD,OAAO,CAAC,sBAAsB;IAc9B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAe5B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAevB,sFAAsF;IACtF,OAAO,CAAC,iBAAiB;IAwBzB,MAAM,KAAK,MAAM,IAAI,cAAc,CA+UlC;CACF"}
@@ -352,6 +352,9 @@ let IAButton = class IAButton extends LitElement {
352
352
  align-items: center;
353
353
  justify-content: center;
354
354
  gap: var(--ia-space-1--);
355
+ /* A link's hover underline doesn't reach into an inline-flex box
356
+ when a host makes the part inline, as ia-reviews' message does. */
357
+ text-decoration: inherit;
355
358
  }
356
359
 
357
360
  /* Full width, so slotted content with width: 100% fills the button.
@@ -414,9 +417,11 @@ let IAButton = class IAButton extends LitElement {
414
417
  border-color: var(--ia-button-custom-border--);
415
418
  }
416
419
 
420
+ /* :focus, not :focus-visible, so a clicked custom button keeps its
421
+ active colors, as hosts that style it that way expect. */
417
422
  .custom:not([aria-disabled='true']):is(
418
423
  :hover,
419
- :focus-visible,
424
+ :focus,
420
425
  :active,
421
426
  .active
422
427
  ) {
@@ -1 +1 @@
1
- {"version":3,"file":"ia-button.js","sourceRoot":"","sources":["../../../../src/elements/ia-button/ia-button.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EAGP,GAAG,EAEH,MAAM,GACP,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD,OAAO,4CAA4C,CAAC;AAEpD,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QACL;;;;WAIG;Q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AG/B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAA0B;AAGzB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAA2B;AAG3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAA0B;AAGV;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAGnB;AAGK;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAAe;AAGb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAAkC;AAzCnD,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAojBpB","sourcesContent":["import {\n html,\n LitElement,\n nothing,\n TemplateResult,\n CSSResultGroup,\n css,\n PropertyValues,\n render,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { customElement } from '@src/utils/custom-element';\nimport themeStyles from '@src/themes/theme-styles';\n\nimport '../ia-status-indicator/ia-status-indicator';\n\nlet warnedTransparent = false;\n\n/**\n * Renders a standardized button built off the ia-button styling and the activity indicator, with the option to show\n * a loading indicator instead of the text or to customize the text, and the ability to pass in any\n * function to run on click. Follows the button spec in docs/components/button.md.\n *\n * A disabled or loading button stays in the tab order (`aria-disabled`)\n * and swallows its own clicks, so neither a listener on the element nor a\n * form submission sees them. With `href`, it renders a link styled as a button.\n *\n * Designed to behave exactly like a native type=\"submit\" or type=\"reset\" button if either type is supplied,\n * i.e. for an <ia-button type=\"submit\" @click=${doSideEffects}></ia-button>,\n * whether the form is submitted via enter or by clicking the button directly, the button will always\n * run doSideEffects() and then submit the form.\n */\n@customElement('ia-button')\nexport class IAButton extends LitElement {\n /**\n * Which version of the button to display. `'transparent'` is deprecated:\n * use `'ghost'`. It still renders as `'ghost'`, and logs a console warning\n * once per page.\n */\n @property({ type: String }) mode:\n | 'primary'\n | 'secondary'\n | 'danger'\n | 'warning'\n | 'donate'\n | 'disabled'\n | 'ghost'\n | 'transparent'\n | 'custom'\n | 'link'\n | 'danger-link' = 'primary';\n\n /* The button's size: 30px, 36px (the default) or 44px tall */\n @property({ type: String }) size: 'sm' | 'md' | 'lg' = 'md';\n\n /* Whether to show a loading indicator instead of the button */\n @property({ type: Boolean }) loading: boolean = false;\n\n /* Whether the button should be disabled, regardless of submission status */\n @property({ type: Boolean }) disabled: boolean = false;\n\n /* Optional text to include next to the loading indicator */\n @property({ type: String }) loadingText: string = '';\n\n /* Type of the button - defaults to 'button' to prevent form submission */\n @property({ type: String, reflect: true }) type:\n | 'button'\n | 'submit'\n | 'reset' = 'button';\n\n /* An optional href, which makes the button a link */\n @property({ type: String }) href?: string;\n\n /* Whether a link opens in a new tab */\n @property({ type: Boolean }) openLinksNewTab: boolean = false;\n\n render(): TemplateResult {\n // No whitespace between the top-level nodes: a text node in the shadow\n // root renders as a space when the host is display:inline.\n return html`${this.href ? this.linkTemplate : this.buttonTemplate}<slot\n name=\"hidden-button\"\n ></slot>`;\n }\n\n protected willUpdate(changed: PropertyValues): void {\n if (\n changed.has('mode') &&\n this.mode === 'transparent' &&\n !warnedTransparent\n ) {\n warnedTransparent = true;\n console.warn(\n 'ia-button: mode=\"transparent\" is deprecated; use mode=\"ghost\".',\n );\n }\n if (changed.has('type')) {\n this.setButtonTypeEmulation();\n }\n // Disabled too, so pressing Enter in the form can't submit through it\n const hiddenButton = this.querySelector<HTMLInputElement>(\n 'input.hidden-button',\n );\n if (hiddenButton) hiddenButton.disabled = this.inactive;\n }\n\n /* Whether the button ignores activation: disabled, or busy loading */\n private get inactive(): boolean {\n return this.disabled || this.loading;\n }\n\n /* The classes the styles key off: mode, size and state */\n private get classes(): string {\n const mode = this.mode === 'transparent' ? 'ghost' : this.mode;\n return [\n 'button',\n mode,\n `size-${this.size}`,\n this.disabled ? 'is-disabled' : '',\n this.loading ? 'is-loading' : '',\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n /* The native button to render */\n private get buttonTemplate(): TemplateResult {\n return html`<button\n part=\"button\"\n class=${this.classes}\n aria-disabled=${this.inactive ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n @click=${this.handleInactiveClick}\n >\n ${this.contentTemplate}\n </button>`;\n }\n\n /* A link styled as a button, for an href */\n private get linkTemplate(): TemplateResult {\n return html`<a\n part=\"button\"\n class=${this.classes}\n href=${this.href ?? ''}\n target=${this.openLinksNewTab ? '_blank' : '_self'}\n rel=${ifDefined(this.openLinksNewTab ? 'noopener' : undefined)}\n aria-disabled=${this.inactive ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n @click=${this.handleInactiveClick}\n >${this.contentTemplate}</a\n >`;\n }\n\n /*\n * The label, and over it while loading, the indicator. The label stays in\n * place but hidden, so the button keeps its width.\n */\n private get contentTemplate(): TemplateResult {\n return html`\n <span class=\"label\"><slot></slot></span>\n ${this.loading ? this.loadingStateTemplate : nothing}\n `;\n }\n\n /* Content to render while button is loading */\n private get loadingStateTemplate(): TemplateResult {\n return html`\n <span class=\"loading-indicator\">\n <ia-status-indicator mode=\"loading\"></ia-status-indicator>\n ${this.loadingText}\n </span>\n `;\n }\n\n /**\n * A disabled or loading button stays focusable, so it gets clicks. Stopped\n * here, they never reach a listener on the element or the form.\n */\n private handleInactiveClick = (e: Event): void => {\n if (!this.inactive) return;\n e.preventDefault();\n e.stopPropagation();\n };\n\n /** Sets up or removes button type emulation as needed */\n private setButtonTypeEmulation(): void {\n const hiddenButton: HTMLInputElement | null = this.querySelector(\n 'input.hidden-button',\n );\n\n if (hiddenButton) {\n hiddenButton.type = this.type;\n return;\n }\n\n this.addHiddenButton();\n this.addEventListener('click', this.handleComponentClick);\n }\n\n /**\n * Triggers form actions (submit/reset) on click, if desired\n * and if actions not already in progress\n */\n private handleComponentClick(e: Event): void {\n if (this.type === 'button' || this.inactive) return;\n\n // No need to submit/reset the form if it's already submitting/resetting\n const formActionsInProgress =\n e instanceof CustomEvent && e.detail.formActionsInProgress;\n if (formActionsInProgress) return;\n\n // Request form submission/reset by clicking the hidden native submit/reset button we added earlier\n const hiddenButton = this.querySelector(\n 'input.hidden-button',\n ) as HTMLInputElement;\n hiddenButton.dispatchEvent(new PointerEvent('click'));\n }\n\n /**\n * Adds a hidden button to the light DOM to\n * emulate native reset/submit button behavior.\n *\n * Used for:\n * - Submitting/resetting the form (on behalf of handleComponentClick)\n * - Activating any component click events if form is submitted with the enter key\n * (via handleFormActions)\n */\n private addHiddenButton(): void {\n if (this.type === 'button') return;\n\n render(\n html`<input\n type=${this.type}\n class=\"hidden-button\"\n style=\"display:none\"\n slot=\"hidden-button\"\n @click=${(e: Event) => this.handleFormActions(e)}\n />`,\n this,\n );\n }\n\n /** Triggers the component's click event manually to prevent extra submission/reset */\n private handleFormActions(e: Event): void {\n /**\n * Prevents the event from bubbling up to the ia-button component itself.\n * This way, if the click on this button is triggered by a click on the component,\n * we don't accidentally bubble up a second click and end up in an infinite loop.\n *\n * And if the click was triggered by form submission (via the enter key), we can hijack the click\n * event to pass that info to the component, so it knows not to\n * re-attempt submission.\n */\n e.stopPropagation();\n\n // Detect if click comes from the parent component,\n // in which case there's no need to trigger a second click on it\n const triggeredByComponentClick = !e.isTrusted;\n if (triggeredByComponentClick) return;\n\n // Trigger parent component click events manually,\n // so it knows not to try to re-submit/re-reset the form\n this.dispatchEvent(\n new CustomEvent('click', { detail: { formActionsInProgress: true } }),\n );\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n css`\n :host {\n --primary-cta-text-color--: var(--primary-cta-text-color);\n --primary-cta-fill--: var(--primary-cta-fill);\n --primary-cta-border--: var(--primary-cta-border);\n\n --secondary-cta-text-color--: var(--secondary-cta-text-color);\n --secondary-cta-fill--: var(--secondary-cta-fill);\n --secondary-cta-border--: var(--secondary-cta-border);\n\n --danger-cta-text-color--: var(--danger-cta-text-color);\n --danger-cta-fill--: var(--danger-cta-fill);\n --danger-cta-border--: var(--danger-cta-border);\n\n --warning-cta-text-color--: var(--warning-cta-text-color);\n --warning-cta-fill--: var(--warning-cta-fill);\n --warning-cta-border--: var(--warning-cta-border);\n\n --donate-cta-text-color--: var(--donate-cta-text-color);\n --donate-cta-fill--: var(--donate-cta-fill);\n --donate-cta-border--: var(--donate-cta-border);\n\n --disabled-cta-text-color--: var(--disabled-cta-text-color);\n --disabled-cta-fill--: var(--disabled-cta-fill);\n --disabled-cta-border--: var(--disabled-cta-border);\n\n --link-color--: var(--link-color);\n --color-danger--: var(--color-danger);\n\n --button-padding--: var(--button-padding);\n --button-width--: var(--button-width);\n --button-height--: var(--button-height);\n --button-border-width--: var(--button-border-width);\n --button-border-radius--: var(--button-border-radius);\n --base-font-family--: var(--base-font-family);\n --font-size-standard--: var(--font-size-standard);\n\n /* Hover snaps; only the press moves. */\n --ia-button-transition--: var(\n --ia-button-transition,\n transform var(--ia-motion-duration-instant--)\n var(--ia-motion-easing-standard--)\n );\n\n --ia-button-custom-text-color--: var(\n --ia-button-custom-text-color,\n var(--primary-cta-text-color--)\n );\n --ia-button-custom-fill--: var(\n --ia-button-custom-fill,\n var(--primary-cta-fill--)\n );\n --ia-button-custom-border--: var(\n --ia-button-custom-border,\n var(--primary-cta-border--)\n );\n --ia-button-custom-active-text-color--: var(\n --ia-button-custom-active-text-color,\n var(--ia-button-custom-text-color--)\n );\n --ia-button-custom-active-fill--: var(\n --ia-button-custom-active-fill,\n var(--ia-button-custom-fill--)\n );\n --ia-button-custom-active-border--: var(\n --ia-button-custom-active-border,\n var(--ia-button-custom-border--)\n );\n\n display: inline-block; /* keeps host sized to button */\n }\n\n .button {\n --_height: var(--button-height--);\n /* A host's own height fits a layout it controls, so it stands on a\n touch screen too; the token heights get the 44px floor. */\n --_touch-min: var(\n --ia-theme-button-height,\n var(--ia-size-target-min--)\n );\n --_padding: var(--button-padding--);\n --_font-size: var(--font-size-standard--);\n --_press: var(--ia-motion-press-scale-default--);\n\n /* The label and the loading indicator share one cell, so the\n button is as wide as the wider of the two. */\n display: inline-grid;\n grid-template-areas: 'stack';\n place-items: center;\n box-sizing: border-box;\n width: var(--button-width--);\n max-width: 100%;\n /* A minimum, not a height: a label longer than its container wraps\n inside the button instead of overflowing it. */\n min-height: var(--_height);\n margin: 0;\n padding: var(--_padding);\n border: var(--button-border-width--) solid transparent;\n border-radius: var(--button-border-radius--);\n background: none;\n color: inherit;\n\n font-family: var(--base-font-family--);\n font-size: var(--_font-size);\n font-weight: var(--ia-font-weight-regular--);\n line-height: var(--ia-font-line-height-tight--);\n text-align: center;\n text-decoration: none;\n /* break-word, not anywhere: anywhere also shrinks the host's\n min-content width, so a host in a tight flex row would break\n its label letter by letter. */\n overflow-wrap: break-word;\n text-wrap: balance;\n\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n transition: var(--ia-button-transition--);\n }\n\n .size-sm {\n --_height: var(--ia-size-control-sm--);\n --_touch-min: var(--ia-size-target-min--);\n --_padding: 0 var(--ia-space-4--);\n }\n\n .size-lg {\n --_height: var(--ia-size-control-lg--);\n --_touch-min: var(--ia-size-target-min--);\n --_padding: 0 var(--ia-space-6--);\n --_font-size: var(--ia-font-size-lg--);\n }\n\n /* Every token size is at least 44px tall to a finger. */\n @media (pointer: coarse) {\n .button {\n min-height: max(var(--_height), var(--_touch-min));\n }\n }\n\n .label,\n .loading-indicator {\n grid-area: stack;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--ia-space-1--);\n }\n\n /* Full width, so slotted content with width: 100% fills the button.\n The label's own content stays centered. */\n .label {\n justify-self: stretch;\n }\n\n .is-loading .label {\n visibility: hidden;\n }\n\n .button:focus-visible {\n outline: var(--ia-size-focus-ring--) solid\n var(--ia-color-border-focus--);\n outline-offset: var(--ia-size-focus-ring-offset--);\n }\n\n .primary {\n color: var(--primary-cta-text-color--);\n background-color: var(--primary-cta-fill--);\n border-color: var(--primary-cta-border--);\n }\n\n /* Light, so it never outweighs the primary; the shadow is what\n sets it apart from ghost, which sits flat. */\n .secondary {\n color: var(--secondary-cta-text-color--);\n background-color: var(--secondary-cta-fill--);\n border-color: var(--secondary-cta-border--);\n box-shadow: var(--ia-shadow-raised--);\n }\n\n .danger {\n color: var(--danger-cta-text-color--);\n background-color: var(--danger-cta-fill--);\n border-color: var(--danger-cta-border--);\n }\n\n .warning {\n color: var(--warning-cta-text-color--);\n background-color: var(--warning-cta-fill--);\n border-color: var(--warning-cta-border--);\n }\n\n .donate {\n color: var(--donate-cta-text-color--);\n background-color: var(--donate-cta-fill--);\n border-color: var(--donate-cta-border--);\n }\n\n /* No boundary: the label or icon identifies it. */\n .ghost {\n border-width: 0;\n }\n\n .custom {\n color: var(--ia-button-custom-text-color--);\n background-color: var(--ia-button-custom-fill--);\n border-color: var(--ia-button-custom-border--);\n }\n\n .custom:not([aria-disabled='true']):is(\n :hover,\n :focus-visible,\n :active,\n .active\n ) {\n color: var(--ia-button-custom-active-text-color--);\n background-color: var(--ia-button-custom-active-fill--);\n border-color: var(--ia-button-custom-active-border--);\n }\n\n /* Link mode keeps the default button height, so it lines up with\n the buttons beside it and --ia-theme-button-height still sets it. */\n .link,\n .danger-link {\n --_padding: 0;\n border-width: 0;\n }\n\n .link {\n color: var(--link-color--);\n }\n\n .danger-link {\n color: var(--color-danger--);\n }\n\n :host(.fit-content) .button {\n padding: 0;\n min-height: fit-content;\n }\n\n /* Hover darkens a filled button a step and lays the overlay on a light\n one, instantly. */\n .primary:hover,\n .danger:hover,\n .donate:hover {\n filter: brightness(0.88);\n }\n\n .warning:hover {\n filter: brightness(0.94);\n }\n\n .secondary:hover,\n .ghost:hover {\n background-image: linear-gradient(\n var(--ia-color-hover-overlay--),\n var(--ia-color-hover-overlay--)\n );\n }\n\n .link:hover,\n .danger-link:hover {\n text-decoration: underline;\n }\n\n /* Press: darker again, and a squeeze sized so the edge travels about\n 1.5px. Links don't move. */\n .button:active {\n filter: brightness(0.8);\n transform: scale(var(--_press));\n }\n\n .link:active,\n .danger-link:active,\n .custom:active {\n filter: none;\n transform: none;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .button:active {\n transform: none;\n }\n }\n\n /* Disabled takes the disabled colors; the label stays legible. The\n disabled mode is the same look on a button that still works. */\n .is-disabled,\n .disabled {\n color: var(--disabled-cta-text-color--);\n background-color: var(--disabled-cta-fill--);\n border-color: var(--disabled-cta-border--);\n box-shadow: none;\n }\n\n .is-disabled:is(.link, .danger-link, .ghost) {\n color: var(--ia-color-text-disabled--);\n background: none;\n }\n\n /* Custom mode keeps the host's own colors when disabled, dimmed. */\n .is-disabled.custom {\n color: var(--ia-button-custom-text-color--);\n background-color: var(--ia-button-custom-fill--);\n border-color: var(--ia-button-custom-border--);\n opacity: 0.5;\n }\n\n /* Last, so no hover or press shows on a button that won't act. */\n .button[aria-disabled='true'] {\n cursor: not-allowed;\n filter: none;\n transform: none;\n background-image: none;\n text-decoration: none;\n }\n\n .button.is-loading {\n cursor: progress;\n }\n\n ia-status-indicator {\n --ia-theme-primary-text-color: currentColor;\n }\n `,\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"ia-button.js","sourceRoot":"","sources":["../../../../src/elements/ia-button/ia-button.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EAGP,GAAG,EAEH,MAAM,GACP,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD,OAAO,4CAA4C,CAAC;AAEpD,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QACL;;;;WAIG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CAAiC;AAG/B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAA0B;AAGzB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAA2B;AAG3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAA0B;AAGV;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAGnB;AAGK;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAAe;AAGb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAAkC;AAzCnD,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAyjBpB","sourcesContent":["import {\n html,\n LitElement,\n nothing,\n TemplateResult,\n CSSResultGroup,\n css,\n PropertyValues,\n render,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { customElement } from '@src/utils/custom-element';\nimport themeStyles from '@src/themes/theme-styles';\n\nimport '../ia-status-indicator/ia-status-indicator';\n\nlet warnedTransparent = false;\n\n/**\n * Renders a standardized button built off the ia-button styling and the activity indicator, with the option to show\n * a loading indicator instead of the text or to customize the text, and the ability to pass in any\n * function to run on click. Follows the button spec in docs/components/button.md.\n *\n * A disabled or loading button stays in the tab order (`aria-disabled`)\n * and swallows its own clicks, so neither a listener on the element nor a\n * form submission sees them. With `href`, it renders a link styled as a button.\n *\n * Designed to behave exactly like a native type=\"submit\" or type=\"reset\" button if either type is supplied,\n * i.e. for an <ia-button type=\"submit\" @click=${doSideEffects}></ia-button>,\n * whether the form is submitted via enter or by clicking the button directly, the button will always\n * run doSideEffects() and then submit the form.\n */\n@customElement('ia-button')\nexport class IAButton extends LitElement {\n /**\n * Which version of the button to display. `'transparent'` is deprecated:\n * use `'ghost'`. It still renders as `'ghost'`, and logs a console warning\n * once per page.\n */\n @property({ type: String }) mode:\n | 'primary'\n | 'secondary'\n | 'danger'\n | 'warning'\n | 'donate'\n | 'disabled'\n | 'ghost'\n | 'transparent'\n | 'custom'\n | 'link'\n | 'danger-link' = 'primary';\n\n /* The button's size: 30px, 36px (the default) or 44px tall */\n @property({ type: String }) size: 'sm' | 'md' | 'lg' = 'md';\n\n /* Whether to show a loading indicator instead of the button */\n @property({ type: Boolean }) loading: boolean = false;\n\n /* Whether the button should be disabled, regardless of submission status */\n @property({ type: Boolean }) disabled: boolean = false;\n\n /* Optional text to include next to the loading indicator */\n @property({ type: String }) loadingText: string = '';\n\n /* Type of the button - defaults to 'button' to prevent form submission */\n @property({ type: String, reflect: true }) type:\n | 'button'\n | 'submit'\n | 'reset' = 'button';\n\n /* An optional href, which makes the button a link */\n @property({ type: String }) href?: string;\n\n /* Whether a link opens in a new tab */\n @property({ type: Boolean }) openLinksNewTab: boolean = false;\n\n render(): TemplateResult {\n // No whitespace between the top-level nodes: a text node in the shadow\n // root renders as a space when the host is display:inline.\n return html`${this.href ? this.linkTemplate : this.buttonTemplate}<slot\n name=\"hidden-button\"\n ></slot>`;\n }\n\n protected willUpdate(changed: PropertyValues): void {\n if (\n changed.has('mode') &&\n this.mode === 'transparent' &&\n !warnedTransparent\n ) {\n warnedTransparent = true;\n console.warn(\n 'ia-button: mode=\"transparent\" is deprecated; use mode=\"ghost\".',\n );\n }\n if (changed.has('type')) {\n this.setButtonTypeEmulation();\n }\n // Disabled too, so pressing Enter in the form can't submit through it\n const hiddenButton = this.querySelector<HTMLInputElement>(\n 'input.hidden-button',\n );\n if (hiddenButton) hiddenButton.disabled = this.inactive;\n }\n\n /* Whether the button ignores activation: disabled, or busy loading */\n private get inactive(): boolean {\n return this.disabled || this.loading;\n }\n\n /* The classes the styles key off: mode, size and state */\n private get classes(): string {\n const mode = this.mode === 'transparent' ? 'ghost' : this.mode;\n return [\n 'button',\n mode,\n `size-${this.size}`,\n this.disabled ? 'is-disabled' : '',\n this.loading ? 'is-loading' : '',\n ]\n .filter(Boolean)\n .join(' ');\n }\n\n /* The native button to render */\n private get buttonTemplate(): TemplateResult {\n return html`<button\n part=\"button\"\n class=${this.classes}\n aria-disabled=${this.inactive ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n @click=${this.handleInactiveClick}\n >\n ${this.contentTemplate}\n </button>`;\n }\n\n /* A link styled as a button, for an href */\n private get linkTemplate(): TemplateResult {\n return html`<a\n part=\"button\"\n class=${this.classes}\n href=${this.href ?? ''}\n target=${this.openLinksNewTab ? '_blank' : '_self'}\n rel=${ifDefined(this.openLinksNewTab ? 'noopener' : undefined)}\n aria-disabled=${this.inactive ? 'true' : nothing}\n aria-busy=${this.loading ? 'true' : nothing}\n @click=${this.handleInactiveClick}\n >${this.contentTemplate}</a\n >`;\n }\n\n /*\n * The label, and over it while loading, the indicator. The label stays in\n * place but hidden, so the button keeps its width.\n */\n private get contentTemplate(): TemplateResult {\n return html`\n <span class=\"label\"><slot></slot></span>\n ${this.loading ? this.loadingStateTemplate : nothing}\n `;\n }\n\n /* Content to render while button is loading */\n private get loadingStateTemplate(): TemplateResult {\n return html`\n <span class=\"loading-indicator\">\n <ia-status-indicator mode=\"loading\"></ia-status-indicator>\n ${this.loadingText}\n </span>\n `;\n }\n\n /**\n * A disabled or loading button stays focusable, so it gets clicks. Stopped\n * here, they never reach a listener on the element or the form.\n */\n private handleInactiveClick = (e: Event): void => {\n if (!this.inactive) return;\n e.preventDefault();\n e.stopPropagation();\n };\n\n /** Sets up or removes button type emulation as needed */\n private setButtonTypeEmulation(): void {\n const hiddenButton: HTMLInputElement | null = this.querySelector(\n 'input.hidden-button',\n );\n\n if (hiddenButton) {\n hiddenButton.type = this.type;\n return;\n }\n\n this.addHiddenButton();\n this.addEventListener('click', this.handleComponentClick);\n }\n\n /**\n * Triggers form actions (submit/reset) on click, if desired\n * and if actions not already in progress\n */\n private handleComponentClick(e: Event): void {\n if (this.type === 'button' || this.inactive) return;\n\n // No need to submit/reset the form if it's already submitting/resetting\n const formActionsInProgress =\n e instanceof CustomEvent && e.detail.formActionsInProgress;\n if (formActionsInProgress) return;\n\n // Request form submission/reset by clicking the hidden native submit/reset button we added earlier\n const hiddenButton = this.querySelector(\n 'input.hidden-button',\n ) as HTMLInputElement;\n hiddenButton.dispatchEvent(new PointerEvent('click'));\n }\n\n /**\n * Adds a hidden button to the light DOM to\n * emulate native reset/submit button behavior.\n *\n * Used for:\n * - Submitting/resetting the form (on behalf of handleComponentClick)\n * - Activating any component click events if form is submitted with the enter key\n * (via handleFormActions)\n */\n private addHiddenButton(): void {\n if (this.type === 'button') return;\n\n render(\n html`<input\n type=${this.type}\n class=\"hidden-button\"\n style=\"display:none\"\n slot=\"hidden-button\"\n @click=${(e: Event) => this.handleFormActions(e)}\n />`,\n this,\n );\n }\n\n /** Triggers the component's click event manually to prevent extra submission/reset */\n private handleFormActions(e: Event): void {\n /**\n * Prevents the event from bubbling up to the ia-button component itself.\n * This way, if the click on this button is triggered by a click on the component,\n * we don't accidentally bubble up a second click and end up in an infinite loop.\n *\n * And if the click was triggered by form submission (via the enter key), we can hijack the click\n * event to pass that info to the component, so it knows not to\n * re-attempt submission.\n */\n e.stopPropagation();\n\n // Detect if click comes from the parent component,\n // in which case there's no need to trigger a second click on it\n const triggeredByComponentClick = !e.isTrusted;\n if (triggeredByComponentClick) return;\n\n // Trigger parent component click events manually,\n // so it knows not to try to re-submit/re-reset the form\n this.dispatchEvent(\n new CustomEvent('click', { detail: { formActionsInProgress: true } }),\n );\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n css`\n :host {\n --primary-cta-text-color--: var(--primary-cta-text-color);\n --primary-cta-fill--: var(--primary-cta-fill);\n --primary-cta-border--: var(--primary-cta-border);\n\n --secondary-cta-text-color--: var(--secondary-cta-text-color);\n --secondary-cta-fill--: var(--secondary-cta-fill);\n --secondary-cta-border--: var(--secondary-cta-border);\n\n --danger-cta-text-color--: var(--danger-cta-text-color);\n --danger-cta-fill--: var(--danger-cta-fill);\n --danger-cta-border--: var(--danger-cta-border);\n\n --warning-cta-text-color--: var(--warning-cta-text-color);\n --warning-cta-fill--: var(--warning-cta-fill);\n --warning-cta-border--: var(--warning-cta-border);\n\n --donate-cta-text-color--: var(--donate-cta-text-color);\n --donate-cta-fill--: var(--donate-cta-fill);\n --donate-cta-border--: var(--donate-cta-border);\n\n --disabled-cta-text-color--: var(--disabled-cta-text-color);\n --disabled-cta-fill--: var(--disabled-cta-fill);\n --disabled-cta-border--: var(--disabled-cta-border);\n\n --link-color--: var(--link-color);\n --color-danger--: var(--color-danger);\n\n --button-padding--: var(--button-padding);\n --button-width--: var(--button-width);\n --button-height--: var(--button-height);\n --button-border-width--: var(--button-border-width);\n --button-border-radius--: var(--button-border-radius);\n --base-font-family--: var(--base-font-family);\n --font-size-standard--: var(--font-size-standard);\n\n /* Hover snaps; only the press moves. */\n --ia-button-transition--: var(\n --ia-button-transition,\n transform var(--ia-motion-duration-instant--)\n var(--ia-motion-easing-standard--)\n );\n\n --ia-button-custom-text-color--: var(\n --ia-button-custom-text-color,\n var(--primary-cta-text-color--)\n );\n --ia-button-custom-fill--: var(\n --ia-button-custom-fill,\n var(--primary-cta-fill--)\n );\n --ia-button-custom-border--: var(\n --ia-button-custom-border,\n var(--primary-cta-border--)\n );\n --ia-button-custom-active-text-color--: var(\n --ia-button-custom-active-text-color,\n var(--ia-button-custom-text-color--)\n );\n --ia-button-custom-active-fill--: var(\n --ia-button-custom-active-fill,\n var(--ia-button-custom-fill--)\n );\n --ia-button-custom-active-border--: var(\n --ia-button-custom-active-border,\n var(--ia-button-custom-border--)\n );\n\n display: inline-block; /* keeps host sized to button */\n }\n\n .button {\n --_height: var(--button-height--);\n /* A host's own height fits a layout it controls, so it stands on a\n touch screen too; the token heights get the 44px floor. */\n --_touch-min: var(\n --ia-theme-button-height,\n var(--ia-size-target-min--)\n );\n --_padding: var(--button-padding--);\n --_font-size: var(--font-size-standard--);\n --_press: var(--ia-motion-press-scale-default--);\n\n /* The label and the loading indicator share one cell, so the\n button is as wide as the wider of the two. */\n display: inline-grid;\n grid-template-areas: 'stack';\n place-items: center;\n box-sizing: border-box;\n width: var(--button-width--);\n max-width: 100%;\n /* A minimum, not a height: a label longer than its container wraps\n inside the button instead of overflowing it. */\n min-height: var(--_height);\n margin: 0;\n padding: var(--_padding);\n border: var(--button-border-width--) solid transparent;\n border-radius: var(--button-border-radius--);\n background: none;\n color: inherit;\n\n font-family: var(--base-font-family--);\n font-size: var(--_font-size);\n font-weight: var(--ia-font-weight-regular--);\n line-height: var(--ia-font-line-height-tight--);\n text-align: center;\n text-decoration: none;\n /* break-word, not anywhere: anywhere also shrinks the host's\n min-content width, so a host in a tight flex row would break\n its label letter by letter. */\n overflow-wrap: break-word;\n text-wrap: balance;\n\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n transition: var(--ia-button-transition--);\n }\n\n .size-sm {\n --_height: var(--ia-size-control-sm--);\n --_touch-min: var(--ia-size-target-min--);\n --_padding: 0 var(--ia-space-4--);\n }\n\n .size-lg {\n --_height: var(--ia-size-control-lg--);\n --_touch-min: var(--ia-size-target-min--);\n --_padding: 0 var(--ia-space-6--);\n --_font-size: var(--ia-font-size-lg--);\n }\n\n /* Every token size is at least 44px tall to a finger. */\n @media (pointer: coarse) {\n .button {\n min-height: max(var(--_height), var(--_touch-min));\n }\n }\n\n .label,\n .loading-indicator {\n grid-area: stack;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--ia-space-1--);\n /* A link's hover underline doesn't reach into an inline-flex box\n when a host makes the part inline, as ia-reviews' message does. */\n text-decoration: inherit;\n }\n\n /* Full width, so slotted content with width: 100% fills the button.\n The label's own content stays centered. */\n .label {\n justify-self: stretch;\n }\n\n .is-loading .label {\n visibility: hidden;\n }\n\n .button:focus-visible {\n outline: var(--ia-size-focus-ring--) solid\n var(--ia-color-border-focus--);\n outline-offset: var(--ia-size-focus-ring-offset--);\n }\n\n .primary {\n color: var(--primary-cta-text-color--);\n background-color: var(--primary-cta-fill--);\n border-color: var(--primary-cta-border--);\n }\n\n /* Light, so it never outweighs the primary; the shadow is what\n sets it apart from ghost, which sits flat. */\n .secondary {\n color: var(--secondary-cta-text-color--);\n background-color: var(--secondary-cta-fill--);\n border-color: var(--secondary-cta-border--);\n box-shadow: var(--ia-shadow-raised--);\n }\n\n .danger {\n color: var(--danger-cta-text-color--);\n background-color: var(--danger-cta-fill--);\n border-color: var(--danger-cta-border--);\n }\n\n .warning {\n color: var(--warning-cta-text-color--);\n background-color: var(--warning-cta-fill--);\n border-color: var(--warning-cta-border--);\n }\n\n .donate {\n color: var(--donate-cta-text-color--);\n background-color: var(--donate-cta-fill--);\n border-color: var(--donate-cta-border--);\n }\n\n /* No boundary: the label or icon identifies it. */\n .ghost {\n border-width: 0;\n }\n\n .custom {\n color: var(--ia-button-custom-text-color--);\n background-color: var(--ia-button-custom-fill--);\n border-color: var(--ia-button-custom-border--);\n }\n\n /* :focus, not :focus-visible, so a clicked custom button keeps its\n active colors, as hosts that style it that way expect. */\n .custom:not([aria-disabled='true']):is(\n :hover,\n :focus,\n :active,\n .active\n ) {\n color: var(--ia-button-custom-active-text-color--);\n background-color: var(--ia-button-custom-active-fill--);\n border-color: var(--ia-button-custom-active-border--);\n }\n\n /* Link mode keeps the default button height, so it lines up with\n the buttons beside it and --ia-theme-button-height still sets it. */\n .link,\n .danger-link {\n --_padding: 0;\n border-width: 0;\n }\n\n .link {\n color: var(--link-color--);\n }\n\n .danger-link {\n color: var(--color-danger--);\n }\n\n :host(.fit-content) .button {\n padding: 0;\n min-height: fit-content;\n }\n\n /* Hover darkens a filled button a step and lays the overlay on a light\n one, instantly. */\n .primary:hover,\n .danger:hover,\n .donate:hover {\n filter: brightness(0.88);\n }\n\n .warning:hover {\n filter: brightness(0.94);\n }\n\n .secondary:hover,\n .ghost:hover {\n background-image: linear-gradient(\n var(--ia-color-hover-overlay--),\n var(--ia-color-hover-overlay--)\n );\n }\n\n .link:hover,\n .danger-link:hover {\n text-decoration: underline;\n }\n\n /* Press: darker again, and a squeeze sized so the edge travels about\n 1.5px. Links don't move. */\n .button:active {\n filter: brightness(0.8);\n transform: scale(var(--_press));\n }\n\n .link:active,\n .danger-link:active,\n .custom:active {\n filter: none;\n transform: none;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .button:active {\n transform: none;\n }\n }\n\n /* Disabled takes the disabled colors; the label stays legible. The\n disabled mode is the same look on a button that still works. */\n .is-disabled,\n .disabled {\n color: var(--disabled-cta-text-color--);\n background-color: var(--disabled-cta-fill--);\n border-color: var(--disabled-cta-border--);\n box-shadow: none;\n }\n\n .is-disabled:is(.link, .danger-link, .ghost) {\n color: var(--ia-color-text-disabled--);\n background: none;\n }\n\n /* Custom mode keeps the host's own colors when disabled, dimmed. */\n .is-disabled.custom {\n color: var(--ia-button-custom-text-color--);\n background-color: var(--ia-button-custom-fill--);\n border-color: var(--ia-button-custom-border--);\n opacity: 0.5;\n }\n\n /* Last, so no hover or press shows on a button that won't act. */\n .button[aria-disabled='true'] {\n cursor: not-allowed;\n filter: none;\n transform: none;\n background-image: none;\n text-decoration: none;\n }\n\n .button.is-loading {\n cursor: progress;\n }\n\n ia-status-indicator {\n --ia-theme-primary-text-color: currentColor;\n }\n `,\n ];\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ia-clearable-text-input.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-clearable-text-input/ia-clearable-text-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAOrE,qBACa,oBAAqB,SAAQ,UAAU;IAClD;;OAEG;IACyB,KAAK,SAAM;IAEvC;;OAEG;IACyB,WAAW,CAAC,EAAE,MAAM,CAAC;IAEjD;;;OAGG;IACyB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAEvD;;;OAGG;IACyB,4BAA4B,SAAW;IAEnE;;;OAGG;IACyB,YAAY,CAAC,EAAE,MAAM,CAAC;IAElD;;;OAGG;IAC0B,YAAY,UAAQ;IAEjD;;;OAGG;IACyC,gBAAgB,UAAS;IAGrE,OAAO,CAAC,SAAS,CAAoB;IAIrC,MAAM,CAAC,iBAAiB;;;;;;;;;MAGtB;IAEF,SAAS,CAAC,MAAM,IAAI,cAAc;IAkClC,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,kBAAkB;IAyB1B,MAAM,CAAC,MAAM,4BA8IX;CACH"}
1
+ {"version":3,"file":"ia-clearable-text-input.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-clearable-text-input/ia-clearable-text-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAOrE,qBACa,oBAAqB,SAAQ,UAAU;IAClD;;OAEG;IACyB,KAAK,SAAM;IAEvC;;OAEG;IACyB,WAAW,CAAC,EAAE,MAAM,CAAC;IAEjD;;;OAGG;IACyB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAEvD;;;OAGG;IACyB,4BAA4B,SAAW;IAEnE;;;OAGG;IACyB,YAAY,CAAC,EAAE,MAAM,CAAC;IAElD;;;OAGG;IAC0B,YAAY,UAAQ;IAEjD;;;OAGG;IACyC,gBAAgB,UAAS;IAGrE,OAAO,CAAC,SAAS,CAAoB;IAIrC,MAAM,CAAC,iBAAiB;;;;;;;;;MAGtB;IAEF,SAAS,CAAC,MAAM,IAAI,cAAc;IAkClC,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,kBAAkB;IAyB1B,MAAM,CAAC,MAAM,4BA4JX;CACH"}
@@ -154,7 +154,12 @@ IaClearableTextInput.styles = [
154
154
  }
155
155
 
156
156
  /* A text field's focus ring is drawn over its border, inside the edge,
157
- so the field looks like it took focus rather than gained a box. */
157
+ so the field looks like it took focus rather than gained a box: the
158
+ border takes the ring's color and an inset shadow makes up the rest
159
+ of its width. It's the default of --input-focused-box-shadow, so a
160
+ host's own focus shadow replaces it rather than adding a second ring.
161
+ The transparent outline is what forced-colors mode shows, since it
162
+ drops box shadows. */
158
163
  #text-input:focus {
159
164
  outline: none;
160
165
  }
@@ -162,11 +167,20 @@ IaClearableTextInput.styles = [
162
167
  #text-input:focus-visible {
163
168
  border-color: var(
164
169
  --input-focused-border-color,
165
- var(--input-border-color, var(--ia-color-border-strong--))
170
+ var(--ia-color-border-focus--)
166
171
  );
167
- box-shadow: var(--input-focused-box-shadow, none);
168
- outline: var(--ia-size-focus-ring--) solid
169
- var(--ia-color-border-focus--);
172
+ box-shadow: var(
173
+ --input-focused-box-shadow,
174
+ inset 0 0 0
175
+ calc(
176
+ var(--ia-size-focus-ring--) - var(
177
+ --input-border-width,
178
+ var(--ia-size-border-width--)
179
+ )
180
+ )
181
+ var(--ia-color-border-focus--)
182
+ );
183
+ outline: var(--ia-size-focus-ring--) solid transparent;
170
184
  outline-offset: var(
171
185
  --input-focus-ring-offset,
172
186
  calc(-1 * var(--ia-size-focus-ring--))
@@ -1 +1 @@
1
- {"version":3,"file":"ia-clearable-text-input.js","sourceRoot":"","sources":["../../../../src/elements/ia-clearable-text-input/ia-clearable-text-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG1C,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;IAA7C;;QACL;;WAEG;QACyB,UAAK,GAAG,EAAE,CAAC;QAavC;;;WAGG;QACyB,iCAA4B,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,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DAAqB;AAML;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8DAA0B;AAG7D;IADP,KAAK,CAAC,aAAa,CAAC;uDACgB;AA1C1B,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAmRhC","sourcesContent":["import { html, css, nothing, LitElement, TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\n\nimport closeIcon from './assets/close';\nimport { tokenStyles } from '@src/themes/tokens';\n\n@customElement('ia-clearable-text-input')\nexport class IaClearableTextInput extends LitElement {\n /**\n * The value shown in the text field.\n */\n @property({ type: String }) value = '';\n\n /**\n * The placeholder value shown in the text field when it is empty.\n */\n @property({ type: String }) placeholder?: string;\n\n /**\n * The accessible label describing the text field for users of screen readers.\n * Must be included to meet accessibility requirements.\n */\n @property({ type: String }) screenReaderLabel?: string;\n\n /**\n * The accessible label describing the clear button for users of screen\n * readers (defaults to 'Clear').\n */\n @property({ type: String }) clearButtonScreenReaderLabel = 'Clear';\n\n /**\n * An element id specifying additional controls for the text field, for\n * users of screen readers.\n */\n @property({ type: String }) ariaControls?: string;\n\n /**\n * Whether the text field should be automatically focused when the clear\n * button is pressed.\n */\n @property({ type: Boolean }) focusOnClear = true;\n\n /**\n * If true, the clear button will be shown regardless of whether there is any\n * text entered in the input field.\n */\n @property({ type: Boolean, reflect: true }) forceClearButton = false;\n\n @query('#text-input')\n private textInput!: HTMLInputElement;\n\n // Options to pass in when creating the shadow root.\n // This ensures that focusing the component delegates focus to the search bar.\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n protected render(): TemplateResult {\n const hideClearButton = !this.value && !this.forceClearButton;\n\n return html`\n <div id=\"container\">\n <slot name=\"icon\"></slot>\n <label for=\"text-input\" class=\"sr-only\"\n >${this.screenReaderLabel ?? nothing}</label\n >\n <input\n id=\"text-input\"\n type=\"text\"\n inputmode=\"search\"\n enterkeyhint=\"search\"\n autocapitalize=\"off\"\n placeholder=${this.placeholder ?? nothing}\n .value=${this.value ?? nothing}\n aria-controls=${this.ariaControls ?? nothing}\n @input=${this.onTextInput}\n @keypress=${this.onKeyPress}\n />\n <button\n id=\"clear-button\"\n type=\"button\"\n ?hidden=${hideClearButton}\n @click=${this.clearButtonClicked}\n >\n <span class=\"clear-icon\" aria-hidden=\"true\">${closeIcon}</span>\n <span class=\"sr-only\">${this.clearButtonScreenReaderLabel}</span>\n </button>\n </div>\n `;\n }\n\n private onTextInput(): void {\n // Update the component value to match the input element\n this.value = this.textInput.value;\n }\n\n private onKeyPress(e: KeyboardEvent): void {\n // Dispatch a 'submit' event if Enter was pressed on the input field, simulating\n // the behavior the input would have within a form. Since native submit events don't\n // cross the Shadow DOM boundary, and since this component may or may not be inside a\n // form element, we emit this event so that parent components don't need to listen for\n // arbitrary key events just for this single use case.\n if (e.key === 'Enter') {\n // Blur the input field\n this.textInput.blur();\n\n const submitEvent = new CustomEvent<string>('submit', {\n detail: this.value,\n });\n this.dispatchEvent(submitEvent);\n }\n }\n\n private clearButtonClicked(): void {\n // Store the value of the text field before clearing it, to send along with the clear event\n const preClearValue = this.textInput.value;\n\n // Empty the text field and focus it if desired\n this.value = '';\n if (this.focusOnClear) this.textInput.focus();\n\n // Dispatch a 'clear' event with the value the text field had prior to clearing\n const clearEvent = new CustomEvent<string>('clear', {\n detail: preClearValue,\n });\n this.dispatchEvent(clearEvent);\n\n // Also dispatch an 'input' event with the newly empty value upon clearing.\n // Note that most ordinary input events are bubbled and retargeted across the Shadow DOM\n // boundary automatically. We only need this here because the input field's value has been\n // cleared programmatically rather than by user keyboard input. We want every value change\n // to produce an input event for consistency.\n const inputEvent = new InputEvent('input', {\n inputType: 'deleteContentBackward',\n });\n this.dispatchEvent(inputEvent);\n }\n\n static styles = [\n tokenStyles,\n css`\n :host {\n --input-height: var(--ia-size-control-sm--);\n --clear-button-top: 0;\n --clear-button-right: 2px;\n }\n\n #container {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n height: var(--input-height);\n }\n\n #text-input {\n width: 100%;\n height: 100%;\n padding: var(--input-padding, 0 var(--ia-space-2--));\n padding-inline-end: var(--input-height);\n border: var(--input-border-width, var(--ia-size-border-width--))\n var(--input-border-style, solid)\n var(--input-border-color, var(--ia-color-border-strong--));\n /* A search field, the one place the pill radius is right. */\n border-radius: var(--input-border-radius, var(--ia-radius-pill--));\n background-image: var(--input-background-image, none);\n background-color: var(--input-background-color, transparent);\n color: var(--input-color, var(--ia-color-text-primary--));\n font-size: var(--input-font-size, var(--ia-font-size-lg--));\n line-height: var(--input-line-height, 1.5);\n box-shadow: var(--input-box-shadow, none);\n }\n\n #text-input::placeholder {\n color: var(--input-placeholder-color, var(--ia-color-text-secondary--));\n }\n\n /* Hover takes the input's own text color, which contrasts with its\n background on any surface: #2c2c2c on light, the light text a dark\n theme sets on dark. */\n #text-input:hover {\n border-color: var(--input-hover-border-color, currentColor);\n }\n\n /* A text field's focus ring is drawn over its border, inside the edge,\n so the field looks like it took focus rather than gained a box. */\n #text-input:focus {\n outline: none;\n }\n\n #text-input:focus-visible {\n border-color: var(\n --input-focused-border-color,\n var(--input-border-color, var(--ia-color-border-strong--))\n );\n box-shadow: var(--input-focused-box-shadow, none);\n outline: var(--ia-size-focus-ring--) solid\n var(--ia-color-border-focus--);\n outline-offset: var(\n --input-focus-ring-offset,\n calc(-1 * var(--ia-size-focus-ring--))\n );\n }\n\n #clear-button {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n inset-block-start: var(--clear-button-top);\n inset-inline-end: var(--clear-button-right);\n height: var(--clear-button-height, var(--input-height));\n width: var(--clear-button-width, var(--input-height));\n padding: var(--clear-button-padding, 4px);\n border: var(--clear-button-border, 0);\n background: none;\n appearance: none;\n cursor: pointer;\n }\n\n #clear-button:focus-visible {\n outline: var(--ia-size-focus-ring--) solid\n var(--ia-color-border-focus--);\n outline-offset: calc(-1 * var(--ia-size-focus-ring--));\n box-shadow: var(--ia-shadow-focus-band--);\n border-radius: var(--ia-radius-circle--);\n }\n\n #clear-button[hidden] {\n display: none;\n }\n\n .clear-icon {\n display: block;\n width: 100%;\n height: 100%;\n background: var(\n --clear-button-icon-background,\n var(--ia-color-text-primary--)\n );\n border-radius: var(--ia-radius-circle--);\n pointer-events: none;\n }\n\n .clear-icon svg {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .clear-icon .fill-color {\n fill: var(--clear-button-icon-color, var(--ia-color-surface-raised--));\n }\n\n /* Fallback support for older browsers without newer bidirectional rules */\n @supports not ((inset-block-start: 0) and (padding-inline-end: 0)) {\n #text-input {\n padding-right: var(--input-height);\n }\n\n #clear-button {\n top: var(--clear-button-top);\n right: var(--clear-button-right);\n }\n }\n\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: -1px !important;\n padding: 0 !important;\n border: 0 !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n }\n `,\n ];\n}\n"]}
1
+ {"version":3,"file":"ia-clearable-text-input.js","sourceRoot":"","sources":["../../../../src/elements/ia-clearable-text-input/ia-clearable-text-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG1C,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;IAA7C;;QACL;;WAEG;QACyB,U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E,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAuB;AAMrB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DAAqB;AAML;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8DAA0B;AAG7D;IADP,KAAK,CAAC,aAAa,CAAC;uDACgB;AA1C1B,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAiShC","sourcesContent":["import { html, css, nothing, LitElement, TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\n\nimport closeIcon from './assets/close';\nimport { tokenStyles } from '@src/themes/tokens';\n\n@customElement('ia-clearable-text-input')\nexport class IaClearableTextInput extends LitElement {\n /**\n * The value shown in the text field.\n */\n @property({ type: String }) value = '';\n\n /**\n * The placeholder value shown in the text field when it is empty.\n */\n @property({ type: String }) placeholder?: string;\n\n /**\n * The accessible label describing the text field for users of screen readers.\n * Must be included to meet accessibility requirements.\n */\n @property({ type: String }) screenReaderLabel?: string;\n\n /**\n * The accessible label describing the clear button for users of screen\n * readers (defaults to 'Clear').\n */\n @property({ type: String }) clearButtonScreenReaderLabel = 'Clear';\n\n /**\n * An element id specifying additional controls for the text field, for\n * users of screen readers.\n */\n @property({ type: String }) ariaControls?: string;\n\n /**\n * Whether the text field should be automatically focused when the clear\n * button is pressed.\n */\n @property({ type: Boolean }) focusOnClear = true;\n\n /**\n * If true, the clear button will be shown regardless of whether there is any\n * text entered in the input field.\n */\n @property({ type: Boolean, reflect: true }) forceClearButton = false;\n\n @query('#text-input')\n private textInput!: HTMLInputElement;\n\n // Options to pass in when creating the shadow root.\n // This ensures that focusing the component delegates focus to the search bar.\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n protected render(): TemplateResult {\n const hideClearButton = !this.value && !this.forceClearButton;\n\n return html`\n <div id=\"container\">\n <slot name=\"icon\"></slot>\n <label for=\"text-input\" class=\"sr-only\"\n >${this.screenReaderLabel ?? nothing}</label\n >\n <input\n id=\"text-input\"\n type=\"text\"\n inputmode=\"search\"\n enterkeyhint=\"search\"\n autocapitalize=\"off\"\n placeholder=${this.placeholder ?? nothing}\n .value=${this.value ?? nothing}\n aria-controls=${this.ariaControls ?? nothing}\n @input=${this.onTextInput}\n @keypress=${this.onKeyPress}\n />\n <button\n id=\"clear-button\"\n type=\"button\"\n ?hidden=${hideClearButton}\n @click=${this.clearButtonClicked}\n >\n <span class=\"clear-icon\" aria-hidden=\"true\">${closeIcon}</span>\n <span class=\"sr-only\">${this.clearButtonScreenReaderLabel}</span>\n </button>\n </div>\n `;\n }\n\n private onTextInput(): void {\n // Update the component value to match the input element\n this.value = this.textInput.value;\n }\n\n private onKeyPress(e: KeyboardEvent): void {\n // Dispatch a 'submit' event if Enter was pressed on the input field, simulating\n // the behavior the input would have within a form. Since native submit events don't\n // cross the Shadow DOM boundary, and since this component may or may not be inside a\n // form element, we emit this event so that parent components don't need to listen for\n // arbitrary key events just for this single use case.\n if (e.key === 'Enter') {\n // Blur the input field\n this.textInput.blur();\n\n const submitEvent = new CustomEvent<string>('submit', {\n detail: this.value,\n });\n this.dispatchEvent(submitEvent);\n }\n }\n\n private clearButtonClicked(): void {\n // Store the value of the text field before clearing it, to send along with the clear event\n const preClearValue = this.textInput.value;\n\n // Empty the text field and focus it if desired\n this.value = '';\n if (this.focusOnClear) this.textInput.focus();\n\n // Dispatch a 'clear' event with the value the text field had prior to clearing\n const clearEvent = new CustomEvent<string>('clear', {\n detail: preClearValue,\n });\n this.dispatchEvent(clearEvent);\n\n // Also dispatch an 'input' event with the newly empty value upon clearing.\n // Note that most ordinary input events are bubbled and retargeted across the Shadow DOM\n // boundary automatically. We only need this here because the input field's value has been\n // cleared programmatically rather than by user keyboard input. We want every value change\n // to produce an input event for consistency.\n const inputEvent = new InputEvent('input', {\n inputType: 'deleteContentBackward',\n });\n this.dispatchEvent(inputEvent);\n }\n\n static styles = [\n tokenStyles,\n css`\n :host {\n --input-height: var(--ia-size-control-sm--);\n --clear-button-top: 0;\n --clear-button-right: 2px;\n }\n\n #container {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n height: var(--input-height);\n }\n\n #text-input {\n width: 100%;\n height: 100%;\n padding: var(--input-padding, 0 var(--ia-space-2--));\n padding-inline-end: var(--input-height);\n border: var(--input-border-width, var(--ia-size-border-width--))\n var(--input-border-style, solid)\n var(--input-border-color, var(--ia-color-border-strong--));\n /* A search field, the one place the pill radius is right. */\n border-radius: var(--input-border-radius, var(--ia-radius-pill--));\n background-image: var(--input-background-image, none);\n background-color: var(--input-background-color, transparent);\n color: var(--input-color, var(--ia-color-text-primary--));\n font-size: var(--input-font-size, var(--ia-font-size-lg--));\n line-height: var(--input-line-height, 1.5);\n box-shadow: var(--input-box-shadow, none);\n }\n\n #text-input::placeholder {\n color: var(--input-placeholder-color, var(--ia-color-text-secondary--));\n }\n\n /* Hover takes the input's own text color, which contrasts with its\n background on any surface: #2c2c2c on light, the light text a dark\n theme sets on dark. */\n #text-input:hover {\n border-color: var(--input-hover-border-color, currentColor);\n }\n\n /* A text field's focus ring is drawn over its border, inside the edge,\n so the field looks like it took focus rather than gained a box: the\n border takes the ring's color and an inset shadow makes up the rest\n of its width. It's the default of --input-focused-box-shadow, so a\n host's own focus shadow replaces it rather than adding a second ring.\n The transparent outline is what forced-colors mode shows, since it\n drops box shadows. */\n #text-input:focus {\n outline: none;\n }\n\n #text-input:focus-visible {\n border-color: var(\n --input-focused-border-color,\n var(--ia-color-border-focus--)\n );\n box-shadow: var(\n --input-focused-box-shadow,\n inset 0 0 0\n calc(\n var(--ia-size-focus-ring--) - var(\n --input-border-width,\n var(--ia-size-border-width--)\n )\n )\n var(--ia-color-border-focus--)\n );\n outline: var(--ia-size-focus-ring--) solid transparent;\n outline-offset: var(\n --input-focus-ring-offset,\n calc(-1 * var(--ia-size-focus-ring--))\n );\n }\n\n #clear-button {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n inset-block-start: var(--clear-button-top);\n inset-inline-end: var(--clear-button-right);\n height: var(--clear-button-height, var(--input-height));\n width: var(--clear-button-width, var(--input-height));\n padding: var(--clear-button-padding, 4px);\n border: var(--clear-button-border, 0);\n background: none;\n appearance: none;\n cursor: pointer;\n }\n\n #clear-button:focus-visible {\n outline: var(--ia-size-focus-ring--) solid\n var(--ia-color-border-focus--);\n outline-offset: calc(-1 * var(--ia-size-focus-ring--));\n box-shadow: var(--ia-shadow-focus-band--);\n border-radius: var(--ia-radius-circle--);\n }\n\n #clear-button[hidden] {\n display: none;\n }\n\n .clear-icon {\n display: block;\n width: 100%;\n height: 100%;\n background: var(\n --clear-button-icon-background,\n var(--ia-color-text-primary--)\n );\n border-radius: var(--ia-radius-circle--);\n pointer-events: none;\n }\n\n .clear-icon svg {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .clear-icon .fill-color {\n fill: var(--clear-button-icon-color, var(--ia-color-surface-raised--));\n }\n\n /* Fallback support for older browsers without newer bidirectional rules */\n @supports not ((inset-block-start: 0) and (padding-inline-end: 0)) {\n #text-input {\n padding-right: var(--input-height);\n }\n\n #clear-button {\n top: var(--clear-button-top);\n right: var(--clear-button-right);\n }\n }\n\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: -1px !important;\n padding: 0 !important;\n border: 0 !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n }\n `,\n ];\n}\n"]}
@@ -407,9 +407,11 @@ let IADonationForm = class IADonationForm extends LitElement {
407
407
  --ia-donation-form-donate-button-text-color,
408
408
  var(--ia-color-action-donate-text--)
409
409
  );
410
+ /* A step darker than the fill, as ia-button's donate mode hovers. A
411
+ color rather than a filter, so a host's hover color shows as set. */
410
412
  --donation-form-donate-button-hover-color--: var(
411
413
  --ia-donation-form-donate-button-hover-color,
412
- var(--ia-color-action-donate-fill--)
414
+ color-mix(in srgb, var(--ia-color-action-donate-fill--) 88%, black)
413
415
  );
414
416
  --donation-form-total-top-margin--: var(
415
417
  --ia-donation-form-total-amount-top-margin,
@@ -458,10 +460,8 @@ let IADonationForm = class IADonationForm extends LitElement {
458
460
  height: var(--donation-form-donate-button-height--);
459
461
  }
460
462
 
461
- /* Hover darkens the fill a step, as ia-button's donate mode does. */
462
463
  #donate-button:hover {
463
464
  background-color: var(--donation-form-donate-button-hover-color--);
464
- filter: brightness(0.88);
465
465
  }
466
466
 
467
467
  #total-amount-section {
@@ -1 +1 @@
1
- {"version":3,"file":"ia-donation-form.js","sourceRoot":"","sources":["../../../../src/elements/ia-donation-form/ia-donation-form.ts"],"names":[],"mappings":";AACA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,GAIX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAInD,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,2CAA2C,CAAC;AAGnD,OAAO,EACL,wBAAwB,GAEzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,2BA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;;OAiGF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA1jB6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAA8C;AAGzE;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DACwB;AAEvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAmC;AAG9D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACqC;AAGpC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAqC;AAErC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAkD;AAG5E;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAEmB;AAG9C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAEiB;AAE3B;IAAhB,KAAK,EAAE;yDAAmC;AAE1B;IAAhB,KAAK,EAAE;0DAAoC;AAE3B;IAAhB,KAAK,EAAE;yDAAkC;AAEzB;IAAhB,KAAK,EAAE;+DAAmD;AAE7B;IAA7B,KAAK,CAAC,qBAAqB,CAAC;0DAAwC;AAExC;IAA5B,KAAK,CAAC,oBAAoB,CAAC;0DAAuC;AAGnE;IADC,KAAK,CAAC,8BAA8B,CAAC;uDACM;AArCjC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA2jB1B","sourcesContent":["import type * as paypal from 'paypal-checkout-components';\nimport {\n css,\n html,\n LitElement,\n type CSSResultGroup,\n type PropertyValues,\n type TemplateResult,\n} from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { iconBoxStyles } from '@src/utils/icon-box';\nimport { msg } from '@lit/localize';\n\nimport themeStyles from '@src/themes/theme-styles';\nimport type { BraintreeManagerInterface } from './braintree/braintree-manager-interface';\nimport type { PaymentFlowHandlersInterface } from './flow-handlers/payment-flow-handlers';\nimport type { IADonationContactForm } from './form-elements/contact-form/ia-donation-contact-form';\nimport {\n EditDonationAmountSelectionLayout,\n EditDonationFrequencySelectionMode,\n} from './form-elements/ia-donation-edit-donation';\nimport type { IADonationHeader } from './form-elements/ia-donation-header';\nimport type { IADonationPaymentSelector } from './form-elements/ia-donation-payment-selector';\nimport {\n DonationSectionBadgeMode,\n type IADonationSection,\n} from './form-elements/ia-donation-section';\nimport { HostedFieldName } from './braintree/payment-providers/credit-card/hosted-field-container';\nimport { lockIcon } from './icons';\nimport {\n DonationPaymentInfo,\n defaultDonationAmounts,\n defaultSelectedDonationInfo,\n} from './models/donation-payment-info';\nimport type { DonationRequest } from './models/donation-request';\nimport { DonationType } from './models/donation-type';\nimport type { DonorContactInfo } from './models/donor-contact-info';\nimport { PaymentProvider } from './models/payment-provider';\nimport { UpsellModalCTAMode } from './modals/ia-donation-upsell-modal-content';\nimport './form-elements/ia-donation-header';\nimport './form-elements/ia-donation-payment-selector';\nimport './form-elements/ia-donation-section';\nimport './form-elements/ia-donation-total-amount';\n\n/**\n * The donation form: amount picker, total, payment method buttons, then the\n * contact form and Donate button for the methods that need them. The\n * controller wires it to Braintree, the modals and recaptcha; on its own it\n * renders and emits events.\n */\n@customElement('ia-donation-form')\nexport class IADonationForm extends LitElement {\n @property({ type: Object }) braintreeManager?: BraintreeManagerInterface;\n\n @property({ type: Object })\n paymentFlowHandlers?: PaymentFlowHandlersInterface;\n\n @property({ type: Object }) donationRequest?: DonationRequest;\n\n @property({ type: Object })\n donationInfo: DonationPaymentInfo = defaultSelectedDonationInfo;\n\n /** The contact form lives in the light DOM (for autofill) and is handed in here */\n @property({ type: Object }) contactForm?: IADonationContactForm;\n\n @property({ type: Array }) amountOptions: number[] = defaultDonationAmounts;\n\n @property({ type: String })\n amountSelectionLayout: EditDonationAmountSelectionLayout =\n EditDonationAmountSelectionLayout.MultiLine;\n\n @property({ type: String })\n frequencySelectionMode: EditDonationFrequencySelectionMode =\n EditDonationFrequencySelectionMode.Button;\n\n @state() private creditCardVisible = false;\n\n @state() private contactFormVisible = false;\n\n @state() private donationInfoValid = true;\n\n @state() private selectedPaymentProvider?: PaymentProvider;\n\n @query('#contactFormSection') contactFormSection?: IADonationSection;\n\n @query('ia-donation-header') donationFormHeader!: IADonationHeader;\n\n @query('ia-donation-payment-selector')\n paymentSelector!: IADonationPaymentSelector;\n\n private paypalButtonNeedsRender = true;\n\n render(): TemplateResult {\n return html`\n <ia-donation-header\n .amountOptions=${this.amountOptions}\n .amountSelectionLayout=${this.amountSelectionLayout}\n .frequencySelectionMode=${this.frequencySelectionMode}\n @donationInfoChanged=${this.donationInfoChanged}\n @editDonationError=${this.editDonationError}\n >\n </ia-donation-header>\n\n <ia-donation-section\n .badgeMode=${DonationSectionBadgeMode.HideBadgeLeaveSpacing}\n id=\"total-amount-section\"\n >\n <ia-donation-total-amount .donationInfo=${this.donationInfo}>\n </ia-donation-total-amount>\n </ia-donation-section>\n\n <ia-donation-section\n .sectionBadge=${`${this.paymentSelectorNumberingStart}`}\n headline=${msg('Choose a payment method')}\n >\n <ia-donation-payment-selector\n .paymentProviders=${this.braintreeManager?.paymentProviders}\n @firstUpdated=${this.paymentSelectorFirstUpdated}\n @creditCardSelected=${this.creditCardSelected}\n @venmoSelected=${this.venmoSelected}\n @applePaySelected=${this.applePaySelected}\n @googlePaySelected=${this.googlePaySelected}\n @paypalBlockerSelected=${this.paypalBlockerSelected}\n @resetPaymentMethod=${() => {\n this.selectedPaymentProvider = undefined;\n this.contactFormVisible = false;\n }}\n >\n <slot name=\"paypal-button\" slot=\"paypal-button\"></slot>\n <div\n class=\"credit-card-fields ${this.creditCardVisible ? '' : 'hidden'}\"\n slot=\"credit-card-fields\"\n >\n <slot name=\"braintree-hosted-fields\"></slot>\n </div>\n </ia-donation-payment-selector>\n </ia-donation-section>\n\n <div\n class=\"contact-form-section ${this.contactFormVisible ? '' : 'hidden'}\"\n >\n ${this.contactFormSectionTemplate}\n </div>\n `;\n }\n\n /** Developer convenience: show the confirmation step without a payment. */\n async showConfirmationModalDev(options: {\n donationType: DonationType;\n amount: number;\n currencyType: string;\n cancelDonationCB: () => void;\n confirmDonationCB: () => void;\n }): Promise<void> {\n this.paymentFlowHandlers?.showConfirmationStepModal(options);\n }\n\n /**\n * Developer convenience: show the upsell modal without going through a\n * payment. With the PayPal slot mode it also renders the PayPal button.\n */\n async showUpsellModalDev(options: {\n oneTimeAmount: number;\n ctaMode?: UpsellModalCTAMode;\n yesSelected?: (amount: number) => void;\n noSelected?: () => void;\n amountChanged?: (amount: number) => void;\n userClosedModalCallback?: () => void;\n }): Promise<void> {\n this.paymentFlowHandlers?.showUpsellModal(options);\n\n if (options.ctaMode === UpsellModalCTAMode.PayPalUpsellSlot) {\n const handler =\n await this.braintreeManager?.paymentProviders.paypalHandler.get();\n const donationInfo = new DonationPaymentInfo({\n amount: options.oneTimeAmount,\n donationType: DonationType.OneTime,\n coverFees: false,\n });\n handler?.renderPayPalButton({\n selector: '#paypal-upsell-button',\n style: {\n color: 'blue' as paypal.ButtonColorOption,\n label: 'paypal' as paypal.ButtonLabelOption,\n shape: 'rect' as paypal.ButtonShapeOption,\n size: 'responsive' as paypal.ButtonSizeOption,\n tagline: false,\n },\n donationInfo,\n });\n }\n }\n\n get contactFormSectionTemplate(): TemplateResult {\n const headline =\n this.selectedPaymentProvider === PaymentProvider.Venmo\n ? msg('Help us stay in touch')\n : msg('Enter contact information');\n\n return html`\n <ia-donation-section\n .sectionBadge=${`${this.paymentSelectorNumberingStart + 1}`}\n headline=${headline}\n id=\"contactFormSection\"\n >\n <slot name=\"contact-form\"></slot>\n </ia-donation-section>\n\n <ia-donation-section\n .sectionBadge=${`${this.paymentSelectorNumberingStart + 2}`}\n >\n <slot name=\"recaptcha\"></slot>\n <button id=\"donate-button\" @click=${this.donateClicked}>\n ${msg('Donate')}\n </button>\n\n <div class=\"secure-process-note\">\n ${lockIcon} ${msg('Your payment will be securely processed')}\n </div>\n </ia-donation-section>\n `;\n }\n\n /**\n * The step number of the payment selector. With the frequency buttons\n * showing they're step 1 and the amount is 2, so payment is 3. In checkbox\n * mode the amount picker is step 1 and payment is 2.\n */\n private get paymentSelectorNumberingStart(): number {\n return this.frequencySelectionMode ===\n EditDonationFrequencySelectionMode.Button\n ? 3\n : 2;\n }\n\n private editDonationError(): void {\n this.donationInfoValid = false;\n }\n\n private paymentSelectorFirstUpdated(): void {\n if (this.paymentFlowHandlers?.paypalHandler) {\n this.renderPayPalButtonIfNeeded();\n }\n }\n\n private applePaySelected(e: CustomEvent): void {\n this.selectedPaymentProvider = PaymentProvider.ApplePay;\n this.contactFormVisible = false;\n this.creditCardVisible = false;\n\n if (!this.donationInfoValid) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n\n const originalEvent = e.detail.originalEvent;\n if (this.donationInfo) {\n this.paymentFlowHandlers?.applePayHandler?.paymentInitiated(\n this.donationInfo,\n originalEvent,\n );\n }\n this.emitPaymentFlowStartedEvent();\n }\n\n private googlePaySelected(): void {\n this.selectedPaymentProvider = PaymentProvider.GooglePay;\n this.contactFormVisible = false;\n this.creditCardVisible = false;\n\n if (!this.donationInfoValid) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n if (this.donationInfo) {\n this.paymentFlowHandlers?.googlePayHandler?.paymentInitiated(\n this.donationInfo,\n );\n }\n this.emitPaymentFlowStartedEvent();\n }\n\n private async creditCardSelected(): Promise<void> {\n if (!this.donationInfoValid) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n this.selectedPaymentProvider = PaymentProvider.CreditCard;\n this.contactFormVisible = true;\n this.creditCardVisible = true;\n this.focusCreditCardNumberField();\n }\n\n private async venmoSelected(): Promise<void> {\n if (!this.donationInfoValid) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n this.selectedPaymentProvider = PaymentProvider.Venmo;\n this.contactFormVisible = true;\n this.creditCardVisible = false;\n this.focusContactForm();\n }\n\n private paypalBlockerSelected(): void {\n this.contactFormVisible = false;\n this.creditCardVisible = false;\n this.showInvalidDonationInfoAlert();\n }\n\n private async focusContactForm(): Promise<void> {\n await this.updateComplete;\n if (this.contactFormSection) {\n this.contactForm?.focus();\n }\n }\n\n private async focusCreditCardNumberField(): Promise<void> {\n await this.updateComplete;\n const creditCardHandler =\n await this.braintreeManager?.paymentProviders.creditCardHandler.get();\n creditCardHandler?.focusField(HostedFieldName.Number);\n }\n\n private async donateClicked(): Promise<void> {\n if (!this.contactForm) {\n alert(msg('Please enter contact info.'));\n return;\n }\n if (!this.donationInfoValid || !this.donationInfo) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n\n const contactInfo = this.contactForm.donorContactInfo;\n\n switch (this.selectedPaymentProvider) {\n case PaymentProvider.CreditCard:\n this.handleCreditCardDonationFlow(contactInfo, this.donationInfo);\n break;\n case PaymentProvider.Venmo:\n this.handleVenmoDonationFlow(contactInfo, this.donationInfo);\n break;\n }\n }\n\n private async handleCreditCardDonationFlow(\n contactInfo: DonorContactInfo,\n donationInfo: DonationPaymentInfo,\n ): Promise<void> {\n const creditCardFlowHandler = this.paymentFlowHandlers?.creditCardHandler;\n const creditCardHandler =\n await this.braintreeManager?.paymentProviders.creditCardHandler.get();\n creditCardHandler?.hideErrorMessage();\n const valid = this.contactForm?.reportValidity();\n const hostedFieldsResponse = await creditCardFlowHandler?.tokenizeFields();\n\n if (!valid || hostedFieldsResponse === undefined) {\n return;\n }\n\n this.emitPaymentFlowStartedEvent();\n creditCardFlowHandler?.paymentInitiated(\n hostedFieldsResponse,\n donationInfo,\n contactInfo,\n );\n }\n\n private async handleVenmoDonationFlow(\n contactInfo: DonorContactInfo,\n donationInfo: DonationPaymentInfo,\n ): Promise<void> {\n const valid = this.contactForm?.reportValidity();\n if (!valid) {\n return;\n }\n this.paymentFlowHandlers?.venmoHandler?.paymentInitiated(\n contactInfo,\n donationInfo,\n );\n }\n\n private emitPaymentFlowEvent(name: string, extra: object = {}): void {\n if (!this.selectedPaymentProvider) {\n return;\n }\n this.dispatchEvent(\n new CustomEvent(name, {\n detail: { paymentProvider: this.selectedPaymentProvider, ...extra },\n }),\n );\n }\n\n private emitPaymentFlowStartedEvent(): void {\n this.emitPaymentFlowEvent('paymentFlowStarted');\n }\n\n private emitPaymentFlowConfirmedEvent(): void {\n this.emitPaymentFlowEvent('paymentFlowConfirmed');\n }\n\n private emitPaymentFlowCancelledEvent(): void {\n this.emitPaymentFlowEvent('paymentFlowCancelled');\n }\n\n private emitPaymentFlowErrorEvent(error?: string): void {\n this.emitPaymentFlowEvent('paymentFlowError', { error });\n }\n\n private showInvalidDonationInfoAlert(): void {\n alert(msg('Please enter a valid donation amount.'));\n }\n\n private async renderPayPalButtonIfNeeded(): Promise<void> {\n if (!this.paypalButtonNeedsRender) {\n return;\n }\n this.paypalButtonNeedsRender = false;\n if (this.donationInfo) {\n await this.paymentFlowHandlers?.paypalHandler?.renderPayPalButton(\n this.donationInfo,\n );\n }\n this.paymentSelector.showPaypalButton();\n }\n\n updated(changedProperties: PropertyValues): void {\n if (changedProperties.has('donationInfo') && this.donationInfo) {\n // The PayPal button holds its own copy of the donation info, since the\n // donor starts that payment from the button rather than from our code\n this.paymentFlowHandlers?.paypalHandler?.updateDonationInfo(\n this.donationInfo,\n );\n this.donationFormHeader.donationInfo = this.donationInfo;\n }\n\n if (\n (changedProperties.has('paymentFlowHandlers') ||\n changedProperties.has('donationInfo')) &&\n this.donationInfo &&\n this.paymentFlowHandlers\n ) {\n this.setupFlowHandlers();\n }\n\n if (changedProperties.has('donationInfoValid')) {\n this.paymentSelector.donationInfoValid = this.donationInfoValid;\n }\n\n if (changedProperties.has('selectedPaymentProvider')) {\n this.dispatchEvent(\n new CustomEvent('paymentProviderSelected', {\n detail: {\n paymentProvider: this.selectedPaymentProvider,\n previousPaymentProvider: changedProperties.get(\n 'selectedPaymentProvider',\n ),\n },\n }),\n );\n }\n }\n\n private flowHandlersConfigured = false;\n\n private setupFlowHandlers(): void {\n if (this.flowHandlersConfigured) {\n return;\n }\n this.flowHandlersConfigured = true;\n this.bindFlowListenerEvents();\n this.renderPayPalButtonIfNeeded();\n if (this.donationInfo) {\n this.paymentFlowHandlers?.paypalHandler?.updateDonationInfo(\n this.donationInfo,\n );\n }\n }\n\n private bindFlowListenerEvents(): void {\n const paypal = this.paymentFlowHandlers?.paypalHandler;\n paypal?.on('payPalPaymentStarted', () => {\n this.selectedPaymentProvider = PaymentProvider.PayPal;\n this.emitPaymentFlowStartedEvent();\n });\n paypal?.on('payPalPaymentConfirmed', () => {\n this.selectedPaymentProvider = PaymentProvider.PayPal;\n this.emitPaymentFlowConfirmedEvent();\n });\n paypal?.on('payPalPaymentCancelled', () => {\n this.selectedPaymentProvider = PaymentProvider.PayPal;\n this.emitPaymentFlowCancelledEvent();\n });\n paypal?.on('payPalPaymentError', (_datasource, error) => {\n this.selectedPaymentProvider = PaymentProvider.PayPal;\n this.emitPaymentFlowErrorEvent(error);\n });\n\n this.paymentFlowHandlers?.googlePayHandler?.on('paymentCancelled', () => {\n this.selectedPaymentProvider = PaymentProvider.GooglePay;\n this.emitPaymentFlowCancelledEvent();\n });\n }\n\n private donationInfoChanged(e: CustomEvent): void {\n const donationInfo: DonationPaymentInfo = e.detail.donationInfo;\n this.donationInfo = new DonationPaymentInfo({\n amount: donationInfo.amount,\n donationType: donationInfo.donationType,\n coverFees: donationInfo.coverFees,\n });\n this.donationInfoValid = true;\n this.dispatchEvent(\n new CustomEvent('donationInfoChanged', { detail: { donationInfo } }),\n );\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n iconBoxStyles,\n css`\n :host {\n /*\n * The donation form was built for a 10px root font size. Sizing off\n * this base keeps it self-contained, so it looks the same whatever\n * the page's root size is. Every part of the form reads it, and the\n * two parts with their own base variable get it passed through.\n */\n --donation-form-base-font-size--: var(\n --ia-donation-form-base-font-size,\n 10px\n );\n --ia-donation-section-base-font-size: var(\n --donation-form-base-font-size--\n );\n --ia-donation-edit-base-font-size: var(\n --donation-form-base-font-size--\n );\n\n --donation-form-donate-button-font-size--: var(\n --ia-donation-form-donate-button-font-size,\n calc(var(--donation-form-base-font-size--) * 2.6)\n );\n --donation-form-donate-button-height--: var(\n --ia-donation-form-donate-button-height,\n calc(var(--donation-form-base-font-size--) * 4)\n );\n --donation-form-donate-button-color--: var(\n --ia-donation-form-donate-button-color,\n var(--ia-color-action-donate-fill--)\n );\n --donation-form-donate-button-text-color--: var(\n --ia-donation-form-donate-button-text-color,\n var(--ia-color-action-donate-text--)\n );\n --donation-form-donate-button-hover-color--: var(\n --ia-donation-form-donate-button-hover-color,\n var(--ia-color-action-donate-fill--)\n );\n --donation-form-total-top-margin--: var(\n --ia-donation-form-total-amount-top-margin,\n calc(var(--donation-form-base-font-size--) * 1.5)\n );\n --donation-form-total-bottom-margin--: var(\n --ia-donation-form-total-amount-bottom-margin,\n calc(var(--donation-form-base-font-size--) * 1.2)\n );\n }\n\n h1 {\n margin: 0;\n padding: 0;\n }\n\n .hidden {\n display: none;\n }\n\n .secure-process-note {\n margin-top: 0.5em;\n font-size: 0.75em;\n text-align: center;\n }\n\n .secure-process-note .ia-icon {\n width: calc(var(--donation-form-base-font-size--) * 1.2);\n height: calc(var(--donation-form-base-font-size--) * 1.5);\n vertical-align: bottom;\n }\n\n #donate-button {\n width: 100%;\n appearance: none;\n font-size: var(--donation-form-donate-button-font-size--);\n font-weight: bold;\n text-align: center;\n color: var(--donation-form-donate-button-text-color--);\n cursor: pointer;\n border: none;\n border-radius: var(--ia-radius-default--);\n background-color: var(--donation-form-donate-button-color--);\n padding-top: var(--padding-sm);\n padding-bottom: var(--padding-sm);\n height: var(--donation-form-donate-button-height--);\n }\n\n /* Hover darkens the fill a step, as ia-button's donate mode does. */\n #donate-button:hover {\n background-color: var(--donation-form-donate-button-hover-color--);\n filter: brightness(0.88);\n }\n\n #total-amount-section {\n display: block;\n margin-top: var(--donation-form-total-top-margin--);\n margin-bottom: var(--donation-form-total-bottom-margin--);\n }\n `,\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"ia-donation-form.js","sourceRoot":"","sources":["../../../../src/elements/ia-donation-form/ia-donation-form.ts"],"names":[],"mappings":";AACA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,GAIX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAInD,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,2CAA2C,CAAC;AAGnD,OAAO,EACL,wBAAwB,GAEzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,oCAAoC,CAAC;AAC5C,OAAO,8CAA8C,CAAC;AACtD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,0CAA0C,CAAC;AAElD;;;;;GAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QASL,iBAAY,GAAwB,2BAA2B,CAAC;QAKrC,kBAAa,GAAa,sBAAsB,CAAC;QAG5E,0BAAqB,GACnB,iCAAiC,CAAC,SAAS,CAAC;QAG9C,2BAAsB,GACp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CAAC;mDAAqC;AAErC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAkD;AAG5E;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAEmB;AAG9C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAEiB;AAE3B;IAAhB,KAAK,EAAE;yDAAmC;AAE1B;IAAhB,KAAK,EAAE;0DAAoC;AAE3B;IAAhB,KAAK,EAAE;yDAAkC;AAEzB;IAAhB,KAAK,EAAE;+DAAmD;AAE7B;IAA7B,KAAK,CAAC,qBAAqB,CAAC;0DAAwC;AAExC;IAA5B,KAAK,CAAC,oBAAoB,CAAC;0DAAuC;AAGnE;IADC,KAAK,CAAC,8BAA8B,CAAC;uDACM;AArCjC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA2jB1B","sourcesContent":["import type * as paypal from 'paypal-checkout-components';\nimport {\n css,\n html,\n LitElement,\n type CSSResultGroup,\n type PropertyValues,\n type TemplateResult,\n} from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { iconBoxStyles } from '@src/utils/icon-box';\nimport { msg } from '@lit/localize';\n\nimport themeStyles from '@src/themes/theme-styles';\nimport type { BraintreeManagerInterface } from './braintree/braintree-manager-interface';\nimport type { PaymentFlowHandlersInterface } from './flow-handlers/payment-flow-handlers';\nimport type { IADonationContactForm } from './form-elements/contact-form/ia-donation-contact-form';\nimport {\n EditDonationAmountSelectionLayout,\n EditDonationFrequencySelectionMode,\n} from './form-elements/ia-donation-edit-donation';\nimport type { IADonationHeader } from './form-elements/ia-donation-header';\nimport type { IADonationPaymentSelector } from './form-elements/ia-donation-payment-selector';\nimport {\n DonationSectionBadgeMode,\n type IADonationSection,\n} from './form-elements/ia-donation-section';\nimport { HostedFieldName } from './braintree/payment-providers/credit-card/hosted-field-container';\nimport { lockIcon } from './icons';\nimport {\n DonationPaymentInfo,\n defaultDonationAmounts,\n defaultSelectedDonationInfo,\n} from './models/donation-payment-info';\nimport type { DonationRequest } from './models/donation-request';\nimport { DonationType } from './models/donation-type';\nimport type { DonorContactInfo } from './models/donor-contact-info';\nimport { PaymentProvider } from './models/payment-provider';\nimport { UpsellModalCTAMode } from './modals/ia-donation-upsell-modal-content';\nimport './form-elements/ia-donation-header';\nimport './form-elements/ia-donation-payment-selector';\nimport './form-elements/ia-donation-section';\nimport './form-elements/ia-donation-total-amount';\n\n/**\n * The donation form: amount picker, total, payment method buttons, then the\n * contact form and Donate button for the methods that need them. The\n * controller wires it to Braintree, the modals and recaptcha; on its own it\n * renders and emits events.\n */\n@customElement('ia-donation-form')\nexport class IADonationForm extends LitElement {\n @property({ type: Object }) braintreeManager?: BraintreeManagerInterface;\n\n @property({ type: Object })\n paymentFlowHandlers?: PaymentFlowHandlersInterface;\n\n @property({ type: Object }) donationRequest?: DonationRequest;\n\n @property({ type: Object })\n donationInfo: DonationPaymentInfo = defaultSelectedDonationInfo;\n\n /** The contact form lives in the light DOM (for autofill) and is handed in here */\n @property({ type: Object }) contactForm?: IADonationContactForm;\n\n @property({ type: Array }) amountOptions: number[] = defaultDonationAmounts;\n\n @property({ type: String })\n amountSelectionLayout: EditDonationAmountSelectionLayout =\n EditDonationAmountSelectionLayout.MultiLine;\n\n @property({ type: String })\n frequencySelectionMode: EditDonationFrequencySelectionMode =\n EditDonationFrequencySelectionMode.Button;\n\n @state() private creditCardVisible = false;\n\n @state() private contactFormVisible = false;\n\n @state() private donationInfoValid = true;\n\n @state() private selectedPaymentProvider?: PaymentProvider;\n\n @query('#contactFormSection') contactFormSection?: IADonationSection;\n\n @query('ia-donation-header') donationFormHeader!: IADonationHeader;\n\n @query('ia-donation-payment-selector')\n paymentSelector!: IADonationPaymentSelector;\n\n private paypalButtonNeedsRender = true;\n\n render(): TemplateResult {\n return html`\n <ia-donation-header\n .amountOptions=${this.amountOptions}\n .amountSelectionLayout=${this.amountSelectionLayout}\n .frequencySelectionMode=${this.frequencySelectionMode}\n @donationInfoChanged=${this.donationInfoChanged}\n @editDonationError=${this.editDonationError}\n >\n </ia-donation-header>\n\n <ia-donation-section\n .badgeMode=${DonationSectionBadgeMode.HideBadgeLeaveSpacing}\n id=\"total-amount-section\"\n >\n <ia-donation-total-amount .donationInfo=${this.donationInfo}>\n </ia-donation-total-amount>\n </ia-donation-section>\n\n <ia-donation-section\n .sectionBadge=${`${this.paymentSelectorNumberingStart}`}\n headline=${msg('Choose a payment method')}\n >\n <ia-donation-payment-selector\n .paymentProviders=${this.braintreeManager?.paymentProviders}\n @firstUpdated=${this.paymentSelectorFirstUpdated}\n @creditCardSelected=${this.creditCardSelected}\n @venmoSelected=${this.venmoSelected}\n @applePaySelected=${this.applePaySelected}\n @googlePaySelected=${this.googlePaySelected}\n @paypalBlockerSelected=${this.paypalBlockerSelected}\n @resetPaymentMethod=${() => {\n this.selectedPaymentProvider = undefined;\n this.contactFormVisible = false;\n }}\n >\n <slot name=\"paypal-button\" slot=\"paypal-button\"></slot>\n <div\n class=\"credit-card-fields ${this.creditCardVisible ? '' : 'hidden'}\"\n slot=\"credit-card-fields\"\n >\n <slot name=\"braintree-hosted-fields\"></slot>\n </div>\n </ia-donation-payment-selector>\n </ia-donation-section>\n\n <div\n class=\"contact-form-section ${this.contactFormVisible ? '' : 'hidden'}\"\n >\n ${this.contactFormSectionTemplate}\n </div>\n `;\n }\n\n /** Developer convenience: show the confirmation step without a payment. */\n async showConfirmationModalDev(options: {\n donationType: DonationType;\n amount: number;\n currencyType: string;\n cancelDonationCB: () => void;\n confirmDonationCB: () => void;\n }): Promise<void> {\n this.paymentFlowHandlers?.showConfirmationStepModal(options);\n }\n\n /**\n * Developer convenience: show the upsell modal without going through a\n * payment. With the PayPal slot mode it also renders the PayPal button.\n */\n async showUpsellModalDev(options: {\n oneTimeAmount: number;\n ctaMode?: UpsellModalCTAMode;\n yesSelected?: (amount: number) => void;\n noSelected?: () => void;\n amountChanged?: (amount: number) => void;\n userClosedModalCallback?: () => void;\n }): Promise<void> {\n this.paymentFlowHandlers?.showUpsellModal(options);\n\n if (options.ctaMode === UpsellModalCTAMode.PayPalUpsellSlot) {\n const handler =\n await this.braintreeManager?.paymentProviders.paypalHandler.get();\n const donationInfo = new DonationPaymentInfo({\n amount: options.oneTimeAmount,\n donationType: DonationType.OneTime,\n coverFees: false,\n });\n handler?.renderPayPalButton({\n selector: '#paypal-upsell-button',\n style: {\n color: 'blue' as paypal.ButtonColorOption,\n label: 'paypal' as paypal.ButtonLabelOption,\n shape: 'rect' as paypal.ButtonShapeOption,\n size: 'responsive' as paypal.ButtonSizeOption,\n tagline: false,\n },\n donationInfo,\n });\n }\n }\n\n get contactFormSectionTemplate(): TemplateResult {\n const headline =\n this.selectedPaymentProvider === PaymentProvider.Venmo\n ? msg('Help us stay in touch')\n : msg('Enter contact information');\n\n return html`\n <ia-donation-section\n .sectionBadge=${`${this.paymentSelectorNumberingStart + 1}`}\n headline=${headline}\n id=\"contactFormSection\"\n >\n <slot name=\"contact-form\"></slot>\n </ia-donation-section>\n\n <ia-donation-section\n .sectionBadge=${`${this.paymentSelectorNumberingStart + 2}`}\n >\n <slot name=\"recaptcha\"></slot>\n <button id=\"donate-button\" @click=${this.donateClicked}>\n ${msg('Donate')}\n </button>\n\n <div class=\"secure-process-note\">\n ${lockIcon} ${msg('Your payment will be securely processed')}\n </div>\n </ia-donation-section>\n `;\n }\n\n /**\n * The step number of the payment selector. With the frequency buttons\n * showing they're step 1 and the amount is 2, so payment is 3. In checkbox\n * mode the amount picker is step 1 and payment is 2.\n */\n private get paymentSelectorNumberingStart(): number {\n return this.frequencySelectionMode ===\n EditDonationFrequencySelectionMode.Button\n ? 3\n : 2;\n }\n\n private editDonationError(): void {\n this.donationInfoValid = false;\n }\n\n private paymentSelectorFirstUpdated(): void {\n if (this.paymentFlowHandlers?.paypalHandler) {\n this.renderPayPalButtonIfNeeded();\n }\n }\n\n private applePaySelected(e: CustomEvent): void {\n this.selectedPaymentProvider = PaymentProvider.ApplePay;\n this.contactFormVisible = false;\n this.creditCardVisible = false;\n\n if (!this.donationInfoValid) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n\n const originalEvent = e.detail.originalEvent;\n if (this.donationInfo) {\n this.paymentFlowHandlers?.applePayHandler?.paymentInitiated(\n this.donationInfo,\n originalEvent,\n );\n }\n this.emitPaymentFlowStartedEvent();\n }\n\n private googlePaySelected(): void {\n this.selectedPaymentProvider = PaymentProvider.GooglePay;\n this.contactFormVisible = false;\n this.creditCardVisible = false;\n\n if (!this.donationInfoValid) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n if (this.donationInfo) {\n this.paymentFlowHandlers?.googlePayHandler?.paymentInitiated(\n this.donationInfo,\n );\n }\n this.emitPaymentFlowStartedEvent();\n }\n\n private async creditCardSelected(): Promise<void> {\n if (!this.donationInfoValid) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n this.selectedPaymentProvider = PaymentProvider.CreditCard;\n this.contactFormVisible = true;\n this.creditCardVisible = true;\n this.focusCreditCardNumberField();\n }\n\n private async venmoSelected(): Promise<void> {\n if (!this.donationInfoValid) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n this.selectedPaymentProvider = PaymentProvider.Venmo;\n this.contactFormVisible = true;\n this.creditCardVisible = false;\n this.focusContactForm();\n }\n\n private paypalBlockerSelected(): void {\n this.contactFormVisible = false;\n this.creditCardVisible = false;\n this.showInvalidDonationInfoAlert();\n }\n\n private async focusContactForm(): Promise<void> {\n await this.updateComplete;\n if (this.contactFormSection) {\n this.contactForm?.focus();\n }\n }\n\n private async focusCreditCardNumberField(): Promise<void> {\n await this.updateComplete;\n const creditCardHandler =\n await this.braintreeManager?.paymentProviders.creditCardHandler.get();\n creditCardHandler?.focusField(HostedFieldName.Number);\n }\n\n private async donateClicked(): Promise<void> {\n if (!this.contactForm) {\n alert(msg('Please enter contact info.'));\n return;\n }\n if (!this.donationInfoValid || !this.donationInfo) {\n this.showInvalidDonationInfoAlert();\n return;\n }\n\n const contactInfo = this.contactForm.donorContactInfo;\n\n switch (this.selectedPaymentProvider) {\n case PaymentProvider.CreditCard:\n this.handleCreditCardDonationFlow(contactInfo, this.donationInfo);\n break;\n case PaymentProvider.Venmo:\n this.handleVenmoDonationFlow(contactInfo, this.donationInfo);\n break;\n }\n }\n\n private async handleCreditCardDonationFlow(\n contactInfo: DonorContactInfo,\n donationInfo: DonationPaymentInfo,\n ): Promise<void> {\n const creditCardFlowHandler = this.paymentFlowHandlers?.creditCardHandler;\n const creditCardHandler =\n await this.braintreeManager?.paymentProviders.creditCardHandler.get();\n creditCardHandler?.hideErrorMessage();\n const valid = this.contactForm?.reportValidity();\n const hostedFieldsResponse = await creditCardFlowHandler?.tokenizeFields();\n\n if (!valid || hostedFieldsResponse === undefined) {\n return;\n }\n\n this.emitPaymentFlowStartedEvent();\n creditCardFlowHandler?.paymentInitiated(\n hostedFieldsResponse,\n donationInfo,\n contactInfo,\n );\n }\n\n private async handleVenmoDonationFlow(\n contactInfo: DonorContactInfo,\n donationInfo: DonationPaymentInfo,\n ): Promise<void> {\n const valid = this.contactForm?.reportValidity();\n if (!valid) {\n return;\n }\n this.paymentFlowHandlers?.venmoHandler?.paymentInitiated(\n contactInfo,\n donationInfo,\n );\n }\n\n private emitPaymentFlowEvent(name: string, extra: object = {}): void {\n if (!this.selectedPaymentProvider) {\n return;\n }\n this.dispatchEvent(\n new CustomEvent(name, {\n detail: { paymentProvider: this.selectedPaymentProvider, ...extra },\n }),\n );\n }\n\n private emitPaymentFlowStartedEvent(): void {\n this.emitPaymentFlowEvent('paymentFlowStarted');\n }\n\n private emitPaymentFlowConfirmedEvent(): void {\n this.emitPaymentFlowEvent('paymentFlowConfirmed');\n }\n\n private emitPaymentFlowCancelledEvent(): void {\n this.emitPaymentFlowEvent('paymentFlowCancelled');\n }\n\n private emitPaymentFlowErrorEvent(error?: string): void {\n this.emitPaymentFlowEvent('paymentFlowError', { error });\n }\n\n private showInvalidDonationInfoAlert(): void {\n alert(msg('Please enter a valid donation amount.'));\n }\n\n private async renderPayPalButtonIfNeeded(): Promise<void> {\n if (!this.paypalButtonNeedsRender) {\n return;\n }\n this.paypalButtonNeedsRender = false;\n if (this.donationInfo) {\n await this.paymentFlowHandlers?.paypalHandler?.renderPayPalButton(\n this.donationInfo,\n );\n }\n this.paymentSelector.showPaypalButton();\n }\n\n updated(changedProperties: PropertyValues): void {\n if (changedProperties.has('donationInfo') && this.donationInfo) {\n // The PayPal button holds its own copy of the donation info, since the\n // donor starts that payment from the button rather than from our code\n this.paymentFlowHandlers?.paypalHandler?.updateDonationInfo(\n this.donationInfo,\n );\n this.donationFormHeader.donationInfo = this.donationInfo;\n }\n\n if (\n (changedProperties.has('paymentFlowHandlers') ||\n changedProperties.has('donationInfo')) &&\n this.donationInfo &&\n this.paymentFlowHandlers\n ) {\n this.setupFlowHandlers();\n }\n\n if (changedProperties.has('donationInfoValid')) {\n this.paymentSelector.donationInfoValid = this.donationInfoValid;\n }\n\n if (changedProperties.has('selectedPaymentProvider')) {\n this.dispatchEvent(\n new CustomEvent('paymentProviderSelected', {\n detail: {\n paymentProvider: this.selectedPaymentProvider,\n previousPaymentProvider: changedProperties.get(\n 'selectedPaymentProvider',\n ),\n },\n }),\n );\n }\n }\n\n private flowHandlersConfigured = false;\n\n private setupFlowHandlers(): void {\n if (this.flowHandlersConfigured) {\n return;\n }\n this.flowHandlersConfigured = true;\n this.bindFlowListenerEvents();\n this.renderPayPalButtonIfNeeded();\n if (this.donationInfo) {\n this.paymentFlowHandlers?.paypalHandler?.updateDonationInfo(\n this.donationInfo,\n );\n }\n }\n\n private bindFlowListenerEvents(): void {\n const paypal = this.paymentFlowHandlers?.paypalHandler;\n paypal?.on('payPalPaymentStarted', () => {\n this.selectedPaymentProvider = PaymentProvider.PayPal;\n this.emitPaymentFlowStartedEvent();\n });\n paypal?.on('payPalPaymentConfirmed', () => {\n this.selectedPaymentProvider = PaymentProvider.PayPal;\n this.emitPaymentFlowConfirmedEvent();\n });\n paypal?.on('payPalPaymentCancelled', () => {\n this.selectedPaymentProvider = PaymentProvider.PayPal;\n this.emitPaymentFlowCancelledEvent();\n });\n paypal?.on('payPalPaymentError', (_datasource, error) => {\n this.selectedPaymentProvider = PaymentProvider.PayPal;\n this.emitPaymentFlowErrorEvent(error);\n });\n\n this.paymentFlowHandlers?.googlePayHandler?.on('paymentCancelled', () => {\n this.selectedPaymentProvider = PaymentProvider.GooglePay;\n this.emitPaymentFlowCancelledEvent();\n });\n }\n\n private donationInfoChanged(e: CustomEvent): void {\n const donationInfo: DonationPaymentInfo = e.detail.donationInfo;\n this.donationInfo = new DonationPaymentInfo({\n amount: donationInfo.amount,\n donationType: donationInfo.donationType,\n coverFees: donationInfo.coverFees,\n });\n this.donationInfoValid = true;\n this.dispatchEvent(\n new CustomEvent('donationInfoChanged', { detail: { donationInfo } }),\n );\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n iconBoxStyles,\n css`\n :host {\n /*\n * The donation form was built for a 10px root font size. Sizing off\n * this base keeps it self-contained, so it looks the same whatever\n * the page's root size is. Every part of the form reads it, and the\n * two parts with their own base variable get it passed through.\n */\n --donation-form-base-font-size--: var(\n --ia-donation-form-base-font-size,\n 10px\n );\n --ia-donation-section-base-font-size: var(\n --donation-form-base-font-size--\n );\n --ia-donation-edit-base-font-size: var(\n --donation-form-base-font-size--\n );\n\n --donation-form-donate-button-font-size--: var(\n --ia-donation-form-donate-button-font-size,\n calc(var(--donation-form-base-font-size--) * 2.6)\n );\n --donation-form-donate-button-height--: var(\n --ia-donation-form-donate-button-height,\n calc(var(--donation-form-base-font-size--) * 4)\n );\n --donation-form-donate-button-color--: var(\n --ia-donation-form-donate-button-color,\n var(--ia-color-action-donate-fill--)\n );\n --donation-form-donate-button-text-color--: var(\n --ia-donation-form-donate-button-text-color,\n var(--ia-color-action-donate-text--)\n );\n /* A step darker than the fill, as ia-button's donate mode hovers. A\n color rather than a filter, so a host's hover color shows as set. */\n --donation-form-donate-button-hover-color--: var(\n --ia-donation-form-donate-button-hover-color,\n color-mix(in srgb, var(--ia-color-action-donate-fill--) 88%, black)\n );\n --donation-form-total-top-margin--: var(\n --ia-donation-form-total-amount-top-margin,\n calc(var(--donation-form-base-font-size--) * 1.5)\n );\n --donation-form-total-bottom-margin--: var(\n --ia-donation-form-total-amount-bottom-margin,\n calc(var(--donation-form-base-font-size--) * 1.2)\n );\n }\n\n h1 {\n margin: 0;\n padding: 0;\n }\n\n .hidden {\n display: none;\n }\n\n .secure-process-note {\n margin-top: 0.5em;\n font-size: 0.75em;\n text-align: center;\n }\n\n .secure-process-note .ia-icon {\n width: calc(var(--donation-form-base-font-size--) * 1.2);\n height: calc(var(--donation-form-base-font-size--) * 1.5);\n vertical-align: bottom;\n }\n\n #donate-button {\n width: 100%;\n appearance: none;\n font-size: var(--donation-form-donate-button-font-size--);\n font-weight: bold;\n text-align: center;\n color: var(--donation-form-donate-button-text-color--);\n cursor: pointer;\n border: none;\n border-radius: var(--ia-radius-default--);\n background-color: var(--donation-form-donate-button-color--);\n padding-top: var(--padding-sm);\n padding-bottom: var(--padding-sm);\n height: var(--donation-form-donate-button-height--);\n }\n\n #donate-button:hover {\n background-color: var(--donation-form-donate-button-hover-color--);\n }\n\n #total-amount-section {\n display: block;\n margin-top: var(--donation-form-total-top-margin--);\n margin-bottom: var(--donation-form-total-bottom-margin--);\n }\n `,\n ];\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ia-dropdown.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-dropdown/ia-dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,cAAc,EACd,cAAc,EACd,cAAc,EACf,MAAM,KAAK,CAAC;AAWb,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,KAAK,E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ED;;;;;;;;OAQG;IACH,IAAI,aAAa,IAAI,cAAc,CAgClC;IAED;;;;;;;;;OASG;IACH,IAAI,gBAAgB,IAAI,cAAc,CAKrC;IAED;;;;;;OAMG;IACH,OAAO,KAAK,gBAAgB,GAU3B;IAED;;;OAGG;IACH,OAAO,KAAK,uBAAuB,GAElC;IAED;;;OAGG;IACH,OAAO,KAAK,yBAAyB,GAEpC;IAED;;OAEG;IACH,OAAO,KAAK,WAAW,GAItB;IAED,MAAM;IAuCN,MAAM,KAAK,MAAM,IAAI,cAAc,CA4XlC;CACF"}
@@ -766,7 +766,14 @@ let IADropdown = class IADropdown extends LitElement {
766
766
  padding: 0;
767
767
  }
768
768
 
769
+ /* A grid, not the flex box the rule above makes it: its one item
770
+ stretches across the row, so the option's text-align
771
+ (--dropdownTextAlign) places the text, while it stays centered
772
+ vertically. */
769
773
  #dropdown-main li > * > .option-text {
774
+ display: grid;
775
+ justify-content: stretch;
776
+ align-items: center;
770
777
  padding: var(
771
778
  --dropdownItemButtonPadding,
772
779
  var(--dropdownItemPaddingTop, 5px)