Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update USWDS typings to incorporate corrections #416

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 1 addition & 67 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,67 +1 @@
import {
accordion as baseAccordion,
banner as baseBanner,
characterCount as baseCharacterCount,
comboBox as baseComboBox,
datePicker as baseDatePicker,
dateRangePicker as baseDateRangePicker,
fileInput as baseFileInput,
footer as baseFooter,
inPageNavigation as baseInPageNavigation,
inputMask as baseInputMask,
languageSelector as baseLanguageSelector,
modal as baseModal,
navigation as baseNavigation,
password as basePassword,
search as baseSearch,
skipnav as baseSkipnav,
timePicker as baseTimePicker,
table as baseTable,
tooltip as baseTooltip,
validator as baseValidator,
} from '@uswds/uswds';

type ComponentLifecycle = (target?: HTMLElement) => any;

interface BaseComponent {
on: ComponentLifecycle;
off: ComponentLifecycle;
}

interface Button extends BaseComponent {}

interface Range extends BaseComponent {
updateCallout(targetRange: HTMLInputElement): void;
}

type Tooltip = typeof baseTooltip &
BaseComponent & {
show(
tooltipBody: HTMLElement,
tooltipTrigger: Element,
position: 'top' | 'right' | 'left' | 'bottom',
): void;
};

export const accordion: typeof baseAccordion & BaseComponent;
export const banner: typeof baseBanner & BaseComponent;
export const button: Button;
export const characterCount: typeof baseCharacterCount & BaseComponent;
export const comboBox: typeof baseComboBox & BaseComponent;
export const datePicker: typeof baseDatePicker & BaseComponent;
export const dateRangePicker: typeof baseDateRangePicker & BaseComponent;
export const fileInput: typeof baseFileInput & BaseComponent;
export const footer: typeof baseFooter & BaseComponent;
export const inPageNavigation: typeof baseInPageNavigation & BaseComponent;
export const inputMask: typeof baseInputMask & BaseComponent;
export const languageSelector: typeof baseLanguageSelector & BaseComponent;
export const modal: typeof baseModal & BaseComponent;
export const navigation: typeof baseNavigation & BaseComponent;
export const password: typeof basePassword & BaseComponent;
export const range: Range;
export const search: typeof baseSearch & BaseComponent;
export const skipnav: typeof baseSkipnav & BaseComponent;
export const timePicker: typeof baseTimePicker & BaseComponent;
export const table: typeof baseTable & BaseComponent;
export const tooltip: Tooltip;
export const validator: typeof baseValidator & BaseComponent;
export * from '@uswds/uswds/js';
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"homepage": "https://github.com/18F/identity-design-system#readme",
"dependencies": {
"@types/uswds__uswds": "^3.3.3",
"@types/uswds__uswds": "^3.7.0",
"@uswds/uswds": "^3.7.1"
},
"devDependencies": {
Expand Down
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
"moduleResolution": "node",
"module": "ESNext",
"target": "ESNext",
"baseUrl": ".",
"paths": {
"*": ["typings/*"]
}
"baseUrl": "."
},
"exclude": ["build", "dist", "packages"]
}
2 changes: 0 additions & 2 deletions typings/uswds__uswds.d.ts

This file was deleted.

Loading