amount-dropdown small fixes (#2561)

* chore(amountDropdown): export types.

* chore(amountDropdown): remove opinionated styling.

* chore(amountDropdown): changeset.

* chore(amountDropdown): props.styling optional

* chore(amountDropdown): fix tests.
This commit is contained in:
Robin Van Roy 2025-08-20 08:59:56 +02:00 committed by GitHub
parent 1437fddf22
commit f6860c4bb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 20 additions and 9 deletions

View file

@ -0,0 +1,5 @@
---
'@lion/ui': patch
---
exports amount-dropdown types

View file

@ -101,9 +101,6 @@ export class LionInputAmountDropdown extends LionInputAmount {
const refs = {
dropdown: {
ref: this.refs.dropdown,
props: {
style: `height: 100%;`,
},
listeners: {
change: this._onDropdownValueChange,
'model-value-changed': this._onDropdownValueChange,
@ -159,7 +156,7 @@ export class LionInputAmountDropdown extends LionInputAmount {
${ref(refs?.dropdown?.ref)}
aria-label="${refs?.dropdown?.labels?.selectCurrency}"
@change="${refs?.dropdown?.listeners?.change}"
style="${refs?.dropdown?.props?.style}"
style="${ifDefined(refs?.dropdown?.props?.style)}"
>
${data?.regionMetaListPreferred?.length
? html`

View file

@ -150,7 +150,6 @@ export function runInputAmountDropdownSuite({ klass } = { klass: LionInputAmount
// @ts-expect-error [allow-protected]
'model-value-changed': el._onDropdownValueChange,
},
props: { style: 'height: 100%;' },
ref: {
value: dropdownNode,
},

View file

@ -8,6 +8,7 @@ import { LionOption } from '@lion/ui/listbox.js';
import { ref } from 'lit/directives/ref.js';
import { html } from 'lit';
import { ifDefined } from 'lit/directives/if-defined.js';
import { isActiveElement } from '../../core/test-helpers/isActiveElement.js';
import { ScopedElementsMixin } from '../../core/src/ScopedElementsMixin.js';
import '@lion/ui/define/lion-input-amount-dropdown.js';
@ -43,7 +44,7 @@ class WithFormControlInputAmountDropdown extends ScopedElementsMixin(LionInputAm
label="${refs?.dropdown?.labels?.country}"
label-sr-only
@model-value-changed="${refs?.dropdown?.listeners['model-value-changed']}"
style="${refs?.dropdown?.props?.style}"
style="${ifDefined(refs?.dropdown?.props?.style)}"
>
${repeat(
data.regionMetaList,
@ -81,7 +82,7 @@ describe('WithFormControlInputAmountDropdown', () => {
label="${refs?.dropdown?.labels?.country}"
label-sr-only
@model-value-changed="${refs?.dropdown?.listeners['model-value-changed']}"
style="${refs?.dropdown?.props?.style}"
style="${ifDefined(refs?.dropdown?.props?.style)}"
interaction-mode="mac"
>
${repeat(
@ -134,7 +135,7 @@ describe('WithFormControlInputAmountDropdown', () => {
label="${refs?.dropdown?.labels?.country}"
label-sr-only
@model-value-changed="${refs?.dropdown?.listeners['model-value-changed']}"
style="${refs?.dropdown?.props?.style}"
style="${ifDefined(refs?.dropdown?.props?.style)}"
interaction-mode="windows/linux"
>
${repeat(

View file

@ -26,7 +26,7 @@ export type TemplateDataForDropdownInputAmount = {
refs: {
dropdown: RefTemplateData & {
ref: DropdownRef;
props: { style: string };
props?: { style?: string };
listeners: {
change: (event: OnDropdownChangeEvent) => void;
'model-value-changed': (event: OnDropdownChangeEvent) => void;

View file

@ -0,0 +1,9 @@
export {
RegionMeta,
TemplateDataForDropdownInputAmount,
AmountDropdownModelValue,
CurrencyCode,
countryToCurrencyList,
RegionToCurrencyMap,
AllCurrenciesSet
} from '../../components/input-amount-dropdown/types/index.js';