From 3acca75a956a30ef75ba126a69a11f6952318eff Mon Sep 17 00:00:00 2001 From: LuLaValva Date: Tue, 21 Jan 2025 14:28:30 -0800 Subject: [PATCH 1/4] refactor(ts): use Marko.HTML instead of Marko.Input when possible --- src/common/menu-utils/index.ts | 2 +- .../components/ebay-dialog-base/component.ts | 4 ++-- .../components/ebay-notice-base/component.ts | 6 +++--- .../ebay-tooltip-overlay/component-browser.ts | 4 ++-- src/components/ebay-area-chart/component.ts | 2 +- src/components/ebay-avatar/index.marko | 4 ++-- src/components/ebay-badge/index.marko | 2 +- src/components/ebay-bar-chart/component.ts | 3 +-- src/components/ebay-breadcrumbs/component.ts | 6 ++---- src/components/ebay-breadcrumbs/index.marko | 2 +- src/components/ebay-button/index.marko | 2 +- src/components/ebay-carousel/component.ts | 2 +- src/components/ebay-ccd/index.marko | 2 +- src/components/ebay-character-count/component.ts | 2 +- src/components/ebay-checkbox/component-browser.ts | 2 +- src/components/ebay-chip/index.marko | 2 +- src/components/ebay-chips-combobox/component.ts | 2 +- src/components/ebay-combobox/component.ts | 4 ++-- src/components/ebay-cta-button/index.marko | 2 +- src/components/ebay-details/component-browser.ts | 3 +-- src/components/ebay-donut-chart/component.ts | 2 +- src/components/ebay-eek/eek-util.ts | 2 +- src/components/ebay-fake-link/component-browser.ts | 2 +- src/components/ebay-fake-menu-button/component.ts | 2 +- src/components/ebay-fake-menu/component.ts | 2 +- src/components/ebay-fake-tabs/index.marko | 6 +++--- src/components/ebay-file-input/component.ts | 4 ++-- src/components/ebay-file-preview-card/component.ts | 2 +- src/components/ebay-filter-menu-button/component.ts | 4 ++-- src/components/ebay-filter-menu/component.ts | 4 ++-- src/components/ebay-filter/component.ts | 3 +-- src/components/ebay-flag/index.marko | 2 +- .../ebay-icon-button/component-browser.ts | 2 +- src/components/ebay-infotip/component.ts | 6 +++--- src/components/ebay-line-chart/component.ts | 3 +-- src/components/ebay-list/component-browser.ts | 11 ++++++----- src/components/ebay-list/index.marko | 6 +----- src/components/ebay-listbox-button/component.ts | 2 +- src/components/ebay-listbox/component.ts | 4 ++-- src/components/ebay-menu-button/component.ts | 2 +- src/components/ebay-menu/component.ts | 2 +- src/components/ebay-menu/index.marko | 2 +- src/components/ebay-pagination/component.ts | 5 ++--- src/components/ebay-pagination/index.marko | 2 +- .../ebay-progress-bar-expressive/component.ts | 2 +- src/components/ebay-progress-bar/index.marko | 2 +- src/components/ebay-progress-spinner/index.marko | 2 +- src/components/ebay-progress-stepper/index.marko | 6 +++--- src/components/ebay-radio/component-browser.ts | 2 +- src/components/ebay-section-title/index.marko | 10 +++++----- src/components/ebay-segmented-buttons/index.marko | 4 ++-- src/components/ebay-select/component.ts | 4 ++-- src/components/ebay-signal/index.marko | 2 +- .../components/ebay-skeleton-avatar/index.marko | 2 +- .../components/ebay-skeleton-button/index.marko | 2 +- .../components/ebay-skeleton-image/index.marko | 2 +- .../components/ebay-skeleton-text/index.marko | 2 +- .../components/ebay-skeleton-textbox/index.marko | 2 +- src/components/ebay-skeleton/index.marko | 2 +- src/components/ebay-star-rating-select/component.ts | 3 +-- src/components/ebay-star-rating/index.marko | 2 +- src/components/ebay-switch/component-browser.ts | 2 +- src/components/ebay-table/component.ts | 8 ++++---- src/components/ebay-tabs/component.ts | 6 +++--- src/components/ebay-textbox/component-browser.ts | 13 ++++++++----- .../ebay-toggle-button-group/component.ts | 3 +-- src/components/ebay-toggle-button/component.ts | 2 +- src/components/ebay-tooltip/component.ts | 2 +- src/components/ebay-tourtip/component.ts | 4 ++-- src/components/ebay-tri-state-checkbox/component.ts | 2 +- src/components/ebay-video/component.ts | 8 ++++---- 71 files changed, 116 insertions(+), 125 deletions(-) diff --git a/src/common/menu-utils/index.ts b/src/common/menu-utils/index.ts index 94aafe2bc..133dd4e4e 100644 --- a/src/common/menu-utils/index.ts +++ b/src/common/menu-utils/index.ts @@ -1,4 +1,4 @@ -export interface MenuItem extends Omit, `on${string}`> { +export interface MenuItem extends Omit { href?: string; value?: string; renderBody?: Marko.Body; diff --git a/src/components/components/ebay-dialog-base/component.ts b/src/components/components/ebay-dialog-base/component.ts index 911628682..7b84c18ad 100644 --- a/src/components/components/ebay-dialog-base/component.ts +++ b/src/components/components/ebay-dialog-base/component.ts @@ -6,7 +6,7 @@ import * as eventUtils from "../../../common/event-utils"; import transition from "../../../common/transition"; import type { WithNormalizedProps } from "../../../global"; -interface DialogBaseInput extends Omit, `on${string}`> { +interface DialogBaseInput extends Omit { "button-position"?: "right" | "left" | "bottom" | "hidden"; "use-hidden-property"?: boolean; "base-el"?: string; @@ -43,7 +43,7 @@ interface DialogBaseInput extends Omit, `on${string}`> { "transition-el"?: "root" | "window"; focus?: string; "prev-button"?: Marko.AttrTag< - Omit, `on${string}`> & + Omit & WithNormalizedProps<{ "a11y-text"?: AttrString; }> diff --git a/src/components/components/ebay-notice-base/component.ts b/src/components/components/ebay-notice-base/component.ts index 6f4bb209b..956552509 100644 --- a/src/components/components/ebay-notice-base/component.ts +++ b/src/components/components/ebay-notice-base/component.ts @@ -2,7 +2,7 @@ import type { AttrString, AttrClass } from "marko/tags-html"; import type { WithNormalizedProps } from "../../../global"; interface NoticeBaseInput - extends Omit, "title" | `on${string}`> { + extends Omit { status?: | "confirmation" | "celebration" @@ -23,12 +23,12 @@ interface NoticeBaseInput footer?: Marko.AttrTag; "a11y-dismiss-text"?: AttrString; title?: Marko.AttrTag< - Marko.Input<"title"> & { + Marko.HTML.Title & { as?: Marko.Renderable; } >; cta?: Marko.AttrTag< - Marko.Input<"a"> & { + Marko.HTML.A & { renderBody?: Marko.Renderable; } >; diff --git a/src/components/components/ebay-tooltip-overlay/component-browser.ts b/src/components/components/ebay-tooltip-overlay/component-browser.ts index 7cb3acc80..f2a1a5896 100644 --- a/src/components/components/ebay-tooltip-overlay/component-browser.ts +++ b/src/components/components/ebay-tooltip-overlay/component-browser.ts @@ -7,13 +7,13 @@ interface TooltipOverlayInput { "style-left"?: string; "style-right"?: string; "style-bottom"?: string; - heading?: Marko.Input<"span"> & { + heading?: Marko.HTML.Span & { as?: keyof Marko.NativeTags; renderBody?: Marko.Body; } & Iterable; id?: string; type: keyof typeof typeRoles; - content?: Marko.AttrTag>; + content?: Marko.AttrTag; "a11y-close-text"?: AttrString; footer?: Marko.AttrTag< Marko.Renderable & { diff --git a/src/components/ebay-area-chart/component.ts b/src/components/ebay-area-chart/component.ts index 4106caeda..5293a5155 100644 --- a/src/components/ebay-area-chart/component.ts +++ b/src/components/ebay-area-chart/component.ts @@ -27,7 +27,7 @@ declare module "highcharts" { } } -interface AreaChartInput extends Omit, `on${string}`> { +interface AreaChartInput extends Omit { title?: Highcharts.TitleOptions["text"]; description?: Highcharts.SeriesAccessibilityOptionsObject["description"]; series: Highcharts.SeriesAreaOptions | Highcharts.SeriesAreaOptions[]; diff --git a/src/components/ebay-avatar/index.marko b/src/components/ebay-avatar/index.marko index 00c747be4..b4166add1 100644 --- a/src/components/ebay-avatar/index.marko +++ b/src/components/ebay-avatar/index.marko @@ -5,12 +5,12 @@ import type { AttrString } from "marko/tags-html"; static type Size = 32 | 40 | 48 | 56 | 64 | 96 | 128; -static interface AvatarInput extends Omit, `on${string}`> { +static interface AvatarInput extends Omit { username?: string; color?: string; "a11y-text"?: AttrString; size?: Size | `${Size}`; - img?: Marko.AttrTag, `on${string}`>>; + img?: Marko.AttrTag>; } export interface Input extends WithNormalizedProps {} diff --git a/src/components/ebay-badge/index.marko b/src/components/ebay-badge/index.marko index 6711eb6a4..d6c11be42 100644 --- a/src/components/ebay-badge/index.marko +++ b/src/components/ebay-badge/index.marko @@ -2,7 +2,7 @@ import { processHtmlAttributes } from "../../common/html-attributes"; import type { AttrClass } from "marko/tags-html"; import type { WithNormalizedProps } from "../../global"; -static interface BadgeInput extends Marko.Input<"span"> { +static interface BadgeInput extends Omit { type?: "menu" | "icon"; number?: number | string; class?: AttrClass; diff --git a/src/components/ebay-bar-chart/component.ts b/src/components/ebay-bar-chart/component.ts index 089731721..f385c21a2 100644 --- a/src/components/ebay-bar-chart/component.ts +++ b/src/components/ebay-bar-chart/component.ts @@ -29,8 +29,7 @@ interface SeriesItem group?: string; } -interface BarChartInput - extends Omit, `on${string}` | "title"> { +interface BarChartInput extends Omit { title: Highcharts.TitleOptions["text"]; description?: Highcharts.SeriesOptionsType["description"]; "x-axis-label-format"?: Highcharts.XAxisLabelsOptions["format"]; diff --git a/src/components/ebay-breadcrumbs/component.ts b/src/components/ebay-breadcrumbs/component.ts index ee9596407..fb1845482 100644 --- a/src/components/ebay-breadcrumbs/component.ts +++ b/src/components/ebay-breadcrumbs/component.ts @@ -4,14 +4,12 @@ import type { AttrClass, AttrString } from "marko/tags-html"; import type { MenuEvent } from "../ebay-menu/component"; import type { WithNormalizedProps } from "../../global"; -interface BreadcrumbsInput extends Omit, `on${string}`> { +interface BreadcrumbsInput extends Omit { "a11y-heading-tag"?: keyof Marko.NativeTags; "a11y-heading-text"?: AttrString; "a11y-menu-button-text"?: AttrString; class?: AttrClass; - items?: Marko.AttrTag< - Marko.Input<"a"> | (Marko.Input<"button"> & { href: never }) - >; + items?: Marko.AttrTag; "on-select"?: (event: { originalEvent: Event; el: HTMLElement }) => void; } diff --git a/src/components/ebay-breadcrumbs/index.marko b/src/components/ebay-breadcrumbs/index.marko index 014c48f97..093cf3559 100644 --- a/src/components/ebay-breadcrumbs/index.marko +++ b/src/components/ebay-breadcrumbs/index.marko @@ -38,7 +38,7 @@ $ var anyHref = (items || []).some((element) => element.href != null); > <@item - type=(anyHref ? 'a' : 'button') as (Marko.Input<"button">["type"]) + type=(anyHref ? 'a' : 'button') as (Marko.HTML.Button["type"]) ...processHtmlAttributes(items[i]) > <${items[i].renderBody}/> diff --git a/src/components/ebay-button/index.marko b/src/components/ebay-button/index.marko index e91209f67..e176b3914 100644 --- a/src/components/ebay-button/index.marko +++ b/src/components/ebay-button/index.marko @@ -10,7 +10,7 @@ export interface ButtonEvent { originalEvent: T; } -export interface ButtonInput extends Omit, `on${string}`> { +export interface ButtonInput extends Omit { href?: string; size?: (typeof validSizes)[number]; priority?: "primary" | "secondary" | "tertiary" | "none"; diff --git a/src/components/ebay-carousel/component.ts b/src/components/ebay-carousel/component.ts index 379b1ab66..a7a0b6ddb 100644 --- a/src/components/ebay-carousel/component.ts +++ b/src/components/ebay-carousel/component.ts @@ -14,7 +14,7 @@ const LEFT = -1; const RIGHT = 1; interface Item { - htmlAttributes?: Marko.Input<"li">; + htmlAttributes?: Marko.HTML.LI; key?: string; class?: AttrClass; style?: AttrStyle; diff --git a/src/components/ebay-ccd/index.marko b/src/components/ebay-ccd/index.marko index 1a3bab737..10da98865 100644 --- a/src/components/ebay-ccd/index.marko +++ b/src/components/ebay-ccd/index.marko @@ -1,6 +1,6 @@ import { processHtmlAttributes } from "../../common/html-attributes"; import type { WithNormalizedProps } from "../../global"; -static interface CCDInput extends Omit, `on${string}`> { +static interface CCDInput extends Omit { max?: string; min?: string; "charger-icon"?: "included" | "not-included"; diff --git a/src/components/ebay-character-count/component.ts b/src/components/ebay-character-count/component.ts index f114f97ad..5ef24945f 100644 --- a/src/components/ebay-character-count/component.ts +++ b/src/components/ebay-character-count/component.ts @@ -6,7 +6,7 @@ export interface CharacterCountEvent { inputAriaLive: Marko.AriaAttributes["aria-live"]; } -interface CharacterCountInput extends Omit, `on${string}`> { +interface CharacterCountInput extends Omit { renderBody?: Marko.Body; value?: string | number; max: number; diff --git a/src/components/ebay-checkbox/component-browser.ts b/src/components/ebay-checkbox/component-browser.ts index 37e177b8b..1c86d8620 100644 --- a/src/components/ebay-checkbox/component-browser.ts +++ b/src/components/ebay-checkbox/component-browser.ts @@ -5,7 +5,7 @@ export interface CheckboxEvent { value: string; checked: boolean; } -interface CheckboxInput extends Omit, `on${string}`> { +interface CheckboxInput extends Omit { "icon-style"?: "rounded" | "square"; "on-change"?: (e: CheckboxEvent) => void; "on-focus"?: (e: CheckboxEvent) => void; diff --git a/src/components/ebay-chip/index.marko b/src/components/ebay-chip/index.marko index f60e48804..e9bd28151 100644 --- a/src/components/ebay-chip/index.marko +++ b/src/components/ebay-chip/index.marko @@ -2,7 +2,7 @@ import { processHtmlAttributes } from "../../common/html-attributes"; import type { WithNormalizedProps } from "../../global"; import type { AttrBoolean, AttrString } from "marko/tags-html"; -static interface ChipInput extends Omit, `on${string}`> { +static interface ChipInput extends Omit { renderBody?: Marko.Body; disabled?: AttrBoolean; "a11y-delete-button-text"?: AttrString; diff --git a/src/components/ebay-chips-combobox/component.ts b/src/components/ebay-chips-combobox/component.ts index 94095fdd3..29b011302 100644 --- a/src/components/ebay-chips-combobox/component.ts +++ b/src/components/ebay-chips-combobox/component.ts @@ -6,7 +6,7 @@ export interface ChipsComboboxEvent { selected: string[]; } -interface ChipsComboboxInput extends Omit, `on${string}`> { +interface ChipsComboboxInput extends Omit { expanded?: boolean; fluid?: boolean; error?: boolean; diff --git a/src/components/ebay-combobox/component.ts b/src/components/ebay-combobox/component.ts index 27776e721..a492071df 100644 --- a/src/components/ebay-combobox/component.ts +++ b/src/components/ebay-combobox/component.ts @@ -20,7 +20,7 @@ export interface ComboboxEvent { options: Input["options"]; } -interface ComboboxInput extends Omit, `on${string}`> { +interface ComboboxInput extends Omit { expanded?: boolean; borderless?: boolean; fluid?: boolean; @@ -28,7 +28,7 @@ interface ComboboxInput extends Omit, `on${string}`> { "list-selection"?: "manual" | "automatic"; "floating-label"?: AttrString; "view-all-options"?: boolean; - button?: Marko.Input<"button"> & + button?: Marko.HTML.Button & Marko.AttrTag<{ htmlAttributes?: Record; renderBody?: Marko.Body; diff --git a/src/components/ebay-cta-button/index.marko b/src/components/ebay-cta-button/index.marko index 11d98694a..2423cdfdb 100644 --- a/src/components/ebay-cta-button/index.marko +++ b/src/components/ebay-cta-button/index.marko @@ -1,7 +1,7 @@ import { processHtmlAttributes } from "../../common/html-attributes" import type { WithNormalizedProps } from "../../global"; -static interface CtaButtonInput extends Marko.Input<"a"> { +static interface CtaButtonInput extends Marko.HTML.A { size?: "default" | "large"; } diff --git a/src/components/ebay-details/component-browser.ts b/src/components/ebay-details/component-browser.ts index 3122bfcd8..65f3af9b3 100644 --- a/src/components/ebay-details/component-browser.ts +++ b/src/components/ebay-details/component-browser.ts @@ -1,7 +1,6 @@ import type { WithNormalizedProps } from "../../global"; -export interface DetailsInput - extends Omit, `on${string}`> { +export interface DetailsInput extends Omit { text: string; size?: "regular" | "small"; alignment?: "regular" | "center"; diff --git a/src/components/ebay-donut-chart/component.ts b/src/components/ebay-donut-chart/component.ts index 7d500b384..47cbe6aa0 100644 --- a/src/components/ebay-donut-chart/component.ts +++ b/src/components/ebay-donut-chart/component.ts @@ -17,7 +17,7 @@ interface SeriesDonutOptions extends Omit { } interface DonutChartInput - extends Omit, `on${string}` | "title"> { + extends Omit { title?: Marko.AttrTag; metricValue?: Marko.AttrTag; metricLabel?: Marko.AttrTag; diff --git a/src/components/ebay-eek/eek-util.ts b/src/components/ebay-eek/eek-util.ts index 68c329a62..4044169a7 100644 --- a/src/components/ebay-eek/eek-util.ts +++ b/src/components/ebay-eek/eek-util.ts @@ -7,7 +7,7 @@ const validRanges = { A: ["G"], }; -interface EekInput extends Omit, `on${string}`> { +interface EekInput extends Omit { max: string; min: string; rating: string; diff --git a/src/components/ebay-fake-link/component-browser.ts b/src/components/ebay-fake-link/component-browser.ts index 5b584a0e5..dbb810014 100644 --- a/src/components/ebay-fake-link/component-browser.ts +++ b/src/components/ebay-fake-link/component-browser.ts @@ -1,7 +1,7 @@ import * as eventUtils from "../../common/event-utils"; import type { WithNormalizedProps } from "../../global"; -interface FakeLinkInput extends Omit, `on${string}`> { +interface FakeLinkInput extends Omit { variant?: "inline" | "standalone"; "on-click"?: (event: { originalEvent: MouseEvent }) => void; "on-escape"?: (event: { originalEvent: KeyboardEvent }) => void; diff --git a/src/components/ebay-fake-menu-button/component.ts b/src/components/ebay-fake-menu-button/component.ts index 7dfa21dd9..3542cf945 100644 --- a/src/components/ebay-fake-menu-button/component.ts +++ b/src/components/ebay-fake-menu-button/component.ts @@ -8,7 +8,7 @@ import type { import type { WithNormalizedProps } from "../../global"; import type { AttrString } from "marko/tags-html"; -interface FakeMenuButtonInput extends Omit, `on${string}`> { +interface FakeMenuButtonInput extends Omit { text?: AttrString; size?: "none" | "large"; "prefix-id"?: string; diff --git a/src/components/ebay-fake-menu/component.ts b/src/components/ebay-fake-menu/component.ts index 8160c1073..202cb1c0a 100644 --- a/src/components/ebay-fake-menu/component.ts +++ b/src/components/ebay-fake-menu/component.ts @@ -23,7 +23,7 @@ export interface Item extends MenuItem { export interface Separator {} interface FakeMenuInput extends BaseMenuInput, - Omit, `on${string}`> { + Omit { items?: Marko.AttrTag; separator?: Marko.AttrTag; "class-prefix"?: string; diff --git a/src/components/ebay-fake-tabs/index.marko b/src/components/ebay-fake-tabs/index.marko index 40397fa6c..b00f00209 100644 --- a/src/components/ebay-fake-tabs/index.marko +++ b/src/components/ebay-fake-tabs/index.marko @@ -10,11 +10,11 @@ $ const { ...htmlInput } = input; -export interface Tab extends Marko.Input<"li"> { +export interface Tab extends Omit { href: string; } -static interface FakeTabsInput extends Omit, `on${string}`> { +static interface FakeTabsInput extends Omit { "selected-index"?: number; tabs?: Marko.AttrTag; "tab-matches-current-url"?: boolean; @@ -22,7 +22,7 @@ static interface FakeTabsInput extends Omit, `on${string}`> { export interface Input extends WithNormalizedProps {} -$ var tabAriaCurrent: Marko.Input<"li">['aria-current'] = tabMatchesCurrentUrl === false ? "true" : "page"; +$ var tabAriaCurrent: Marko.HTML.LI['aria-current'] = tabMatchesCurrentUrl === false ? "true" : "page";
, `on${string}` | "type"> { + extends Omit { renderBody?: Marko.Body; header?: Marko.AttrTag< Marko.Input<`h${number}`> & { as?: `h${number}`; } >; - subheader?: Marko.AttrTag>; + subheader?: Marko.AttrTag; "on-input"?: (event: FileInputEvent) => void; } diff --git a/src/components/ebay-file-preview-card/component.ts b/src/components/ebay-file-preview-card/component.ts index 940eb0b28..5f6a796b1 100644 --- a/src/components/ebay-file-preview-card/component.ts +++ b/src/components/ebay-file-preview-card/component.ts @@ -13,7 +13,7 @@ export type FilePreviewCardMenuAction = { label: string; }; -interface FilePreviewCardInput extends Omit, `on${string}`> { +interface FilePreviewCardInput extends Omit { "a11y-cancel-upload-text"?: AttrString; "delete-text"?: AttrString; as?: keyof Marko.NativeTags; diff --git a/src/components/ebay-filter-menu-button/component.ts b/src/components/ebay-filter-menu-button/component.ts index d318eed07..0888560f6 100644 --- a/src/components/ebay-filter-menu-button/component.ts +++ b/src/components/ebay-filter-menu-button/component.ts @@ -19,12 +19,12 @@ export interface FilterMenuButtonEvent { interface FilterMenuButtonInput extends BaseMenuInput, - Omit, `on${string}`> { + Omit { text?: AttrString; "footer-text"?: AttrString; "a11y-footer-text"?: AttrString; footer?: WithNormalizedProps< - Omit, `on${string}`> & { + Omit & { "a11y-footer-text"?: AttrString; } >; diff --git a/src/components/ebay-filter-menu/component.ts b/src/components/ebay-filter-menu/component.ts index 87c67ada4..8ddb23a73 100644 --- a/src/components/ebay-filter-menu/component.ts +++ b/src/components/ebay-filter-menu/component.ts @@ -21,7 +21,7 @@ export interface FilterMenuEvent { interface FilterMenuInput extends BaseMenuInput, - Omit, `on${string}`> { + Omit { variant?: "form"; "class-prefix"?: string; "form-name"?: string; @@ -30,7 +30,7 @@ interface FilterMenuInput "footer-text"?: AttrString; "a11y-footer-text"?: AttrString; footer?: WithNormalizedProps< - Omit, `on${string}`> & { + Omit & { "a11y-footer-text"?: AttrString; } >; diff --git a/src/components/ebay-filter/component.ts b/src/components/ebay-filter/component.ts index 655e4c4d0..3657d9cf7 100644 --- a/src/components/ebay-filter/component.ts +++ b/src/components/ebay-filter/component.ts @@ -1,8 +1,7 @@ import type { AttrString } from "marko/tags-html"; import type { WithNormalizedProps } from "../../global"; -export interface FilterInput - extends Omit, `on${string}`> { +export interface FilterInput extends Omit { selected?: boolean; href?: string; "use-aria-pressed"?: boolean; diff --git a/src/components/ebay-flag/index.marko b/src/components/ebay-flag/index.marko index 87ff7e58a..9d519c339 100644 --- a/src/components/ebay-flag/index.marko +++ b/src/components/ebay-flag/index.marko @@ -1,6 +1,6 @@ import type { WithNormalizedProps } from "../../global"; static { - interface FlagInput extends Omit, `on${string}`> { + interface FlagInput extends Omit { flag?: string; } } diff --git a/src/components/ebay-icon-button/component-browser.ts b/src/components/ebay-icon-button/component-browser.ts index 049abafe3..fb2aeeccb 100644 --- a/src/components/ebay-icon-button/component-browser.ts +++ b/src/components/ebay-icon-button/component-browser.ts @@ -3,7 +3,7 @@ import * as eventUtils from "../../common/event-utils"; import type { WithNormalizedProps } from "../../global"; import type { Input as ButtonInput } from "../ebay-button/index.marko"; -interface IconButtonInput extends Omit, `on${string}`> { +interface IconButtonInput extends Omit { "badge-number"?: number | string; href?: string; transparent?: boolean; diff --git a/src/components/ebay-infotip/component.ts b/src/components/ebay-infotip/component.ts index e6204df9b..135ac11c5 100644 --- a/src/components/ebay-infotip/component.ts +++ b/src/components/ebay-infotip/component.ts @@ -3,7 +3,7 @@ import type { WithNormalizedProps } from "../../global"; import EbayTooltipBase from "../components/ebay-tooltip-base/component-browser"; import type { Input as TooltipBaseInput } from "../components/ebay-tooltip-base/component-browser"; -interface InfotipInput extends Omit, `on${string}`> { +interface InfotipInput extends Omit { open?: boolean; variant?: "modal" | "default"; offset?: TooltipBaseInput["offset"]; @@ -12,7 +12,7 @@ interface InfotipInput extends Omit, `on${string}`> { disabled?: boolean; icon?: Marko.AttrTag<{ renderBody: Marko.Renderable }>; heading?: Marko.AttrTag< - Marko.Input<"span"> & { + Marko.HTML.Span & { as?: keyof Marko.NativeTags; renderBody?: Marko.Renderable; } @@ -20,7 +20,7 @@ interface InfotipInput extends Omit, `on${string}`> { "no-flip"?: TooltipBaseInput["no-flip"]; "not-inline"?: TooltipBaseInput["not-inline"]; "no-shift"?: TooltipBaseInput["no-shift"]; - content: Marko.AttrTag>; + content: Marko.AttrTag; "a11y-close-button-text"?: AttrString; "on-expand"?: () => void; "on-collapse"?: () => void; diff --git a/src/components/ebay-line-chart/component.ts b/src/components/ebay-line-chart/component.ts index c085b33db..884234888 100644 --- a/src/components/ebay-line-chart/component.ts +++ b/src/components/ebay-line-chart/component.ts @@ -28,8 +28,7 @@ interface SeriesLineOptions extends Highcharts.PlotLineOptions { type: "line", } -interface LineChartInput - extends Omit, `on${string}` | "title"> { +interface LineChartInput extends Omit { title?: Highcharts.TitleOptions["text"]; description?: Highcharts.PlotLineOptions["description"]; "x-axis-label-format"?: Highcharts.XAxisLabelsOptions["format"]; diff --git a/src/components/ebay-list/component-browser.ts b/src/components/ebay-list/component-browser.ts index 83a017ef4..a986078f8 100644 --- a/src/components/ebay-list/component-browser.ts +++ b/src/components/ebay-list/component-browser.ts @@ -1,12 +1,13 @@ import type { WithNormalizedProps } from "../../global"; -export interface ListItem extends Omit, `on${string}`> { - leading?: Marko.AttrTag>; - trailing?: Marko.AttrTag>; +export interface ListItem extends Omit { + as?: keyof Marko.NativeTags; + separator?: boolean; + leading?: Marko.AttrTag; + trailing?: Marko.AttrTag; } -interface ListInput extends Omit, `on${string}`> { +interface ListInput extends Omit { items?: Marko.AttrTag; - separator?: boolean; "on-button-click"?: (event: { index: number }) => void; } diff --git a/src/components/ebay-list/index.marko b/src/components/ebay-list/index.marko index ca1748f24..ed54c8b5c 100644 --- a/src/components/ebay-list/index.marko +++ b/src/components/ebay-list/index.marko @@ -8,7 +8,7 @@ $ const {
    - + $ const { class: itemInputClass, style: itemStyle, @@ -38,12 +38,10 @@ $ const { $ const { class: leadingInputClass, - leadingStyle, ...leadingInput } = leading;
    <${leading}/> @@ -55,12 +53,10 @@ $ const { $ const { class: trailingInputClass, - trailingStyle, ...trailingInput } = trailing;
    <${trailing}/> diff --git a/src/components/ebay-listbox-button/component.ts b/src/components/ebay-listbox-button/component.ts index 560c78b48..fee8881cf 100644 --- a/src/components/ebay-listbox-button/component.ts +++ b/src/components/ebay-listbox-button/component.ts @@ -6,7 +6,7 @@ import type { ChangeEvent } from "../ebay-listbox/component"; import type { WithNormalizedProps } from "../../global"; import type { AttrString } from "marko/tags-html"; -interface ListboxButtonInput extends Omit, `on${string}`> { +interface ListboxButtonInput extends Omit { options?: ListboxInput["options"]; name?: ListboxInput["name"]; "list-selection"?: ListboxInput["listSelection"]; diff --git a/src/components/ebay-listbox/component.ts b/src/components/ebay-listbox/component.ts index 251b963db..37ec11226 100644 --- a/src/components/ebay-listbox/component.ts +++ b/src/components/ebay-listbox/component.ts @@ -13,14 +13,14 @@ export interface ChangeEvent { el: HTMLOptionElement; } -export interface Option extends Omit, `on${string}`> { +export interface Option extends Omit { disabled?: boolean; text?: AttrString; description?: Marko.AttrTag<{ renderBody?: Marko.Body }>; icon?: Marko.AttrTag<{ renderBody?: Marko.Body }>; } -interface ListboxInput extends Omit, `on${string}`> { +interface ListboxInput extends Omit { "list-selection"?: "auto" | "manual"; "typeahead-timeout-length"?: number; options?: Marko.AttrTag