From 672933ce20b5908c0fa6183c68c9126dccf730d4 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Mon, 7 Dec 2020 05:51:19 -0800 Subject: [PATCH 1/6] docs: use svelte-readme --- .prettierignore | 1 + README.md | 17 ++ demo/src/routes/index.svelte | 10 +- package.json | 21 +- rollup.config.js | 54 +++-- yarn.lock | 396 +++++++++++++++++++++++++++++++---- 6 files changed, 429 insertions(+), 70 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..42061c0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/README.md b/README.md index 8d975be..88d4b0c 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,23 @@ This component library implements [Primer CSS components](https://primer.style/css/components). +```svelte + + +

- - + GitHub @@ -112,7 +112,8 @@ alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=64" width="20" - height="20" /> + height="20" + /> @@ -120,9 +121,10 @@ { + on:click="{() => { copy(); - }} /> + }}" + /> @@ -148,14 +150,16 @@ a_new_feature_branch + bind:value="{radioGroupValue}" + options="{[{ value: 'Option A' }, { value: 'Option B' }, { value: 'Option C' }]}" +/> {radioGroupValue} + let:props +> @@ -170,20 +174,23 @@ + placeholder="Search by user" +> GitHub Inc Hubot Monalisa Octocat + bind:value="{selectValue}" + options="{[{ value: 'Choose an option' }, { value: 'Git' }, { value: 'Subversion' }]}" +/> {selectValue}
{ + on:click="{() => { selectValue = 'Choose an option'; - }}> + }}" +> Reset selectValue
@@ -194,9 +201,10 @@ Box body { + on:click="{() => { console.log('click'); - }}> + }}" + > @@ -214,12 +222,13 @@
- +

Popover heading

Message about this particular piece of UI.

@@ -245,10 +254,11 @@
+ src="https://github.com/jonrohan.png?v=3&s=96" + />
@@ -282,24 +292,26 @@ -Default -Outline -Primary +Default +Outline +Primary
- Transparent + Transparent
+ src="https://github.com/jonrohan.png?v=3&s=96" + /> @@ -339,7 +351,7 @@ - + 6 @@ -353,7 +365,7 @@ + + + + + +
+ + + + + +
+ + + + +
+ + + +``` + +## ButtonMarketing + +```svelte + + +Default +Primary +Outline + +Default large +Primary large +Outline large +
+ Transparent +
+``` + ## BranchName ```svelte @@ -168,6 +260,29 @@ Open: {open} ``` +## Pagination + +```svelte + + + + + + + + + + 1 + 2 + + 9 + 10 + + +``` + ## Truncate ```svelte @@ -182,6 +297,19 @@ Open: {open}
``` +## SelectMenu + +```svelte + + + + Item 1 + Item 2 + Item 3 + +``` --- From ec33bac3c5931042e785e56132dc419c8929d70c Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 19 Dec 2020 15:42:57 -0800 Subject: [PATCH 5/6] chore: re-create TS definitions --- package.json | 2 +- src/Avatar/Avatar.svelte | 11 ++++++----- src/Header/HeaderLink.svelte | 2 +- types/Alert.d.ts | 18 ++++++++--------- types/Autocomplete/Autocomplete.d.ts | 27 +++++++++++++------------- types/Avatar/Avatar.d.ts | 11 ++++------- types/Avatar/AvatarParentChild.d.ts | 17 ++++++++-------- types/Avatar/AvatarStack.d.ts | 14 ++++++-------- types/Avatar/CircleBadge.d.ts | 18 ++++++++--------- types/Avatar/DashedConnection.d.ts | 17 ++++++++-------- types/Blankslate.d.ts | 17 ++++++++-------- types/Box/Box.d.ts | 17 ++++++++-------- types/BoxOverlay.d.ts | 15 ++++++-------- types/BranchName.d.ts | 18 ++++++++--------- types/Breadcrumb/Breadcrumb.d.ts | 14 ++++++-------- types/Button/Button.d.ts | 18 ++++++++--------- types/Button/ButtonGroup.d.ts | 17 ++++++++-------- types/Button/ButtonMarketing.d.ts | 23 ++++++++-------------- types/Button/ButtonWithCount.d.ts | 19 ++++++++---------- types/Dropdown/Dropdown.d.ts | 19 ++++++++++-------- types/Form/Form.d.ts | 18 ++++++++--------- types/Header/Header.d.ts | 17 ++++++++-------- types/Label/Label.d.ts | 29 +++++++++++++++++----------- types/Label/LabelCounter.d.ts | 18 ++++++++--------- types/Label/LabelDiffstat.d.ts | 20 ++++++++----------- types/Label/LabelIssue.d.ts | 18 ++++++++--------- types/Label/LabelState.d.ts | 18 ++++++++--------- types/Loader.d.ts | 14 ++++++-------- types/Pagehead.d.ts | 18 ++++++++--------- types/Pagination/Pagination.d.ts | 17 ++++++++-------- types/Popover/Popover.d.ts | 17 ++++++++-------- types/Progress.d.ts | 17 ++++++++-------- types/SelectMenu/SelectMenu.d.ts | 17 ++++++---------- types/Subhead.d.ts | 14 +++++++------- types/Toast.d.ts | 18 ++++++++--------- types/Tooltip.d.ts | 17 ++++++++-------- types/Truncate.d.ts | 17 ++++++++-------- 37 files changed, 283 insertions(+), 335 deletions(-) diff --git a/package.json b/package.json index affc8a6..e61249e 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "predeploy": "rollup -c", "deploy": "npx gh-pages -d dist", "prepack": "BUNDLE=true rollup -c", - "format": "prettier --write '*/**/*.svelte'" + "format": "prettier --write '{src,types}/**/*.{svelte,ts}'" }, "dependencies": { "svelte-octicons": "^9.6.3" diff --git a/src/Avatar/Avatar.svelte b/src/Avatar/Avatar.svelte index a25cbfc..2d3c997 100644 --- a/src/Avatar/Avatar.svelte +++ b/src/Avatar/Avatar.svelte @@ -37,8 +37,9 @@ + class:avatar="{true}" + class:avatar-small="{small}" + class:avatar-child="{child}" + width="{width}" + height="{height}" +/> diff --git a/src/Header/HeaderLink.svelte b/src/Header/HeaderLink.svelte index 964a510..68cb173 100644 --- a/src/Header/HeaderLink.svelte +++ b/src/Header/HeaderLink.svelte @@ -1,4 +1,4 @@ - + diff --git a/types/Alert.d.ts b/types/Alert.d.ts index 665712f..3337471 100644 --- a/types/Alert.d.ts +++ b/types/Alert.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface AlertProps extends svelte.JSX.HTMLAttributes { +export interface AlertProps + extends svelte.JSX.HTMLAttributes { /** * @default false */ @@ -19,12 +21,8 @@ export interface AlertProps extends svelte.JSX.HTMLAttributes) => void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Alert extends SvelteComponentTyped< + AlertProps, + { dismiss: CustomEvent }, + { default: {} } +> {} diff --git a/types/Autocomplete/Autocomplete.d.ts b/types/Autocomplete/Autocomplete.d.ts index a3c7e9b..e56c9b5 100644 --- a/types/Autocomplete/Autocomplete.d.ts +++ b/types/Autocomplete/Autocomplete.d.ts @@ -1,4 +1,5 @@ /// +import { SvelteComponentTyped } from "svelte"; export interface AutocompleteProps { /** @@ -7,17 +8,15 @@ export interface AutocompleteProps { value?: string; } -export default class Autocomplete { - $$prop_def: AutocompleteProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: "input", cb: (event: WindowEventMap["input"]) => void): () => void; - $on(eventname: "change", cb: (event: WindowEventMap["change"]) => void): () => void; - $on(eventname: "focus", cb: (event: WindowEventMap["focus"]) => void): () => void; - $on(eventname: "blur", cb: (event: WindowEventMap["blur"]) => void): () => void; - $on(eventname: "keydown", cb: (event: WindowEventMap["keydown"]) => void): () => void; - $on(eventname: "keyup", cb: (event: WindowEventMap["keyup"]) => void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Autocomplete extends SvelteComponentTyped< + AutocompleteProps, + { + input: WindowEventMap["input"]; + change: WindowEventMap["change"]; + focus: WindowEventMap["focus"]; + blur: WindowEventMap["blur"]; + keydown: WindowEventMap["keydown"]; + keyup: WindowEventMap["keyup"]; + }, + { default: {} } +> {} diff --git a/types/Avatar/Avatar.d.ts b/types/Avatar/Avatar.d.ts index efde73c..a482a6e 100644 --- a/types/Avatar/Avatar.d.ts +++ b/types/Avatar/Avatar.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface AvatarProps extends svelte.JSX.HTMLAttributes { +export interface AvatarProps + extends svelte.JSX.HTMLAttributes { /** * @default false */ @@ -27,9 +29,4 @@ export interface AvatarProps extends svelte.JSX.HTMLAttributes void): () => void; -} +export default class Avatar extends SvelteComponentTyped {} diff --git a/types/Avatar/AvatarParentChild.d.ts b/types/Avatar/AvatarParentChild.d.ts index 6fe9401..93c8ee5 100644 --- a/types/Avatar/AvatarParentChild.d.ts +++ b/types/Avatar/AvatarParentChild.d.ts @@ -1,12 +1,11 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface AvatarParentChildProps extends svelte.JSX.HTMLAttributes {} +export interface AvatarParentChildProps + extends svelte.JSX.HTMLAttributes {} -export default class AvatarParentChild { - $$prop_def: AvatarParentChildProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class AvatarParentChild extends SvelteComponentTyped< + AvatarParentChildProps, + {}, + { default: {} } +> {} diff --git a/types/Avatar/AvatarStack.d.ts b/types/Avatar/AvatarStack.d.ts index f3ceacd..9cb2398 100644 --- a/types/Avatar/AvatarStack.d.ts +++ b/types/Avatar/AvatarStack.d.ts @@ -1,4 +1,5 @@ /// +import { SvelteComponentTyped } from "svelte"; export interface AvatarStackProps { /** @@ -12,11 +13,8 @@ export interface AvatarStackProps { align?: "left" | "right"; } -export default class AvatarStack { - $$prop_def: AvatarStackProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class AvatarStack extends SvelteComponentTyped< + AvatarStackProps, + {}, + { default: {} } +> {} diff --git a/types/Avatar/CircleBadge.d.ts b/types/Avatar/CircleBadge.d.ts index 17e9e6a..b5397a4 100644 --- a/types/Avatar/CircleBadge.d.ts +++ b/types/Avatar/CircleBadge.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface CircleBadgeProps extends svelte.JSX.HTMLAttributes { +export interface CircleBadgeProps + extends svelte.JSX.HTMLAttributes { /** * @default "small" */ @@ -9,12 +11,8 @@ export interface CircleBadgeProps extends svelte.JSX.HTMLAttributes void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class CircleBadge extends SvelteComponentTyped< + CircleBadgeProps, + { click: WindowEventMap["click"] }, + { default: { props: { class: "CircleBadge-icon" } } } +> {} diff --git a/types/Avatar/DashedConnection.d.ts b/types/Avatar/DashedConnection.d.ts index 88fd480..a06fda2 100644 --- a/types/Avatar/DashedConnection.d.ts +++ b/types/Avatar/DashedConnection.d.ts @@ -1,17 +1,16 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface DashedConnectionProps extends svelte.JSX.HTMLAttributes { +export interface DashedConnectionProps + extends svelte.JSX.HTMLAttributes { /** * @default "Title" */ title?: string; } -export default class DashedConnection { - $$prop_def: DashedConnectionProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class DashedConnection extends SvelteComponentTyped< + DashedConnectionProps, + {}, + { default: {} } +> {} diff --git a/types/Blankslate.d.ts b/types/Blankslate.d.ts index b0b181b..607d05c 100644 --- a/types/Blankslate.d.ts +++ b/types/Blankslate.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface BlankslateProps extends svelte.JSX.HTMLAttributes { +export interface BlankslateProps + extends svelte.JSX.HTMLAttributes { size?: "narrow" | "spacious"; /** @@ -19,11 +21,8 @@ export interface BlankslateProps extends svelte.JSX.HTMLAttributes void): () => void; -} +export default class Blankslate extends SvelteComponentTyped< + BlankslateProps, + {}, + { default: {} } +> {} diff --git a/types/Box/Box.d.ts b/types/Box/Box.d.ts index 056fea5..8455150 100644 --- a/types/Box/Box.d.ts +++ b/types/Box/Box.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface BoxProps extends svelte.JSX.HTMLAttributes { +export interface BoxProps + extends svelte.JSX.HTMLAttributes { border?: undefined | "dashed"; /** @@ -16,11 +18,8 @@ export interface BoxProps extends svelte.JSX.HTMLAttributes void): () => void; -} +export default class Box extends SvelteComponentTyped< + BoxProps, + {}, + { default: {} } +> {} diff --git a/types/BoxOverlay.d.ts b/types/BoxOverlay.d.ts index 43396ba..b73c994 100644 --- a/types/BoxOverlay.d.ts +++ b/types/BoxOverlay.d.ts @@ -1,4 +1,5 @@ /// +import { SvelteComponentTyped } from "svelte"; export interface BoxOverlayProps { /** @@ -19,12 +20,8 @@ export interface BoxOverlayProps { transparentOverlay?: boolean; } -export default class BoxOverlay { - $$prop_def: BoxOverlayProps; - $$slot_def: { - default: {}; - footer: { props: { class: "Box-footer" } }; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class BoxOverlay extends SvelteComponentTyped< + BoxOverlayProps, + {}, + { default: {}; footer: { props: { class: "Box-footer" } } } +> {} diff --git a/types/BranchName.d.ts b/types/BranchName.d.ts index e91c7e0..301aa5e 100644 --- a/types/BranchName.d.ts +++ b/types/BranchName.d.ts @@ -1,15 +1,13 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface BranchNameProps extends svelte.JSX.HTMLAttributes { +export interface BranchNameProps + extends svelte.JSX.HTMLAttributes { href?: string; } -export default class BranchName { - $$prop_def: BranchNameProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class BranchName extends SvelteComponentTyped< + BranchNameProps, + { click: WindowEventMap["click"] }, + { default: {} } +> {} diff --git a/types/Breadcrumb/Breadcrumb.d.ts b/types/Breadcrumb/Breadcrumb.d.ts index cfeea85..54ef70c 100644 --- a/types/Breadcrumb/Breadcrumb.d.ts +++ b/types/Breadcrumb/Breadcrumb.d.ts @@ -1,12 +1,10 @@ /// +import { SvelteComponentTyped } from "svelte"; export interface BreadcrumbProps {} -export default class Breadcrumb { - $$prop_def: BreadcrumbProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Breadcrumb extends SvelteComponentTyped< + BreadcrumbProps, + {}, + { default: {} } +> {} diff --git a/types/Button/Button.d.ts b/types/Button/Button.d.ts index e18bc6c..2f8cf35 100644 --- a/types/Button/Button.d.ts +++ b/types/Button/Button.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface ButtonProps extends svelte.JSX.HTMLAttributes { +export interface ButtonProps + extends svelte.JSX.HTMLAttributes { /** * @default "button" */ @@ -51,12 +53,8 @@ export interface ButtonProps extends svelte.JSX.HTMLAttributes void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Button extends SvelteComponentTyped< + ButtonProps, + { click: WindowEventMap["click"] }, + { default: {} } +> {} diff --git a/types/Button/ButtonGroup.d.ts b/types/Button/ButtonGroup.d.ts index 0560790..bc6c37f 100644 --- a/types/Button/ButtonGroup.d.ts +++ b/types/Button/ButtonGroup.d.ts @@ -1,12 +1,11 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface ButtonGroupProps extends svelte.JSX.HTMLAttributes {} +export interface ButtonGroupProps + extends svelte.JSX.HTMLAttributes {} -export default class ButtonGroup { - $$prop_def: ButtonGroupProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class ButtonGroup extends SvelteComponentTyped< + ButtonGroupProps, + {}, + { default: {} } +> {} diff --git a/types/Button/ButtonMarketing.d.ts b/types/Button/ButtonMarketing.d.ts index 15869c3..266e348 100644 --- a/types/Button/ButtonMarketing.d.ts +++ b/types/Button/ButtonMarketing.d.ts @@ -1,11 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface ButtonMarketingProps extends svelte.JSX.HTMLAttributes { - /** - * @default "button" - */ - type?: string; - +export interface ButtonMarketingProps + extends svelte.JSX.HTMLAttributes { kind?: "primary" | "outline"; /** @@ -19,12 +16,8 @@ export interface ButtonMarketingProps extends svelte.JSX.HTMLAttributes void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class ButtonMarketing extends SvelteComponentTyped< + ButtonMarketingProps, + { click: WindowEventMap["click"] }, + { default: {} } +> {} diff --git a/types/Button/ButtonWithCount.d.ts b/types/Button/ButtonWithCount.d.ts index 75d53ce..0dc121c 100644 --- a/types/Button/ButtonWithCount.d.ts +++ b/types/Button/ButtonWithCount.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface ButtonWithCountProps extends svelte.JSX.HTMLAttributes { +export interface ButtonWithCountProps + extends svelte.JSX.HTMLAttributes { /** * @default "#" */ @@ -17,13 +19,8 @@ export interface ButtonWithCountProps extends svelte.JSX.HTMLAttributes void): () => void; - $on(eventname: "click:count", cb: (event: CustomEvent) => void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class ButtonWithCount extends SvelteComponentTyped< + ButtonWithCountProps, + { click: WindowEventMap["click"]; ["click:count"]: CustomEvent }, + { default: {} } +> {} diff --git a/types/Dropdown/Dropdown.d.ts b/types/Dropdown/Dropdown.d.ts index 75a1eb9..8c57874 100644 --- a/types/Dropdown/Dropdown.d.ts +++ b/types/Dropdown/Dropdown.d.ts @@ -1,4 +1,5 @@ /// +import { SvelteComponentTyped } from "svelte"; export interface DropdownProps { /** @@ -15,13 +16,15 @@ export interface DropdownProps { * @default false */ dark?: boolean; -} - -export default class Dropdown { - $$prop_def: DropdownProps; - $$slot_def: { - default: {}; - }; - $on(eventname: string, cb: (event: Event) => void): () => void; + /** + * @default false + */ + open?: boolean; } + +export default class Dropdown extends SvelteComponentTyped< + DropdownProps, + {}, + { default: {} } +> {} diff --git a/types/Form/Form.d.ts b/types/Form/Form.d.ts index 7c2af78..17859c4 100644 --- a/types/Form/Form.d.ts +++ b/types/Form/Form.d.ts @@ -1,13 +1,11 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface FormProps extends svelte.JSX.HTMLAttributes {} +export interface FormProps + extends svelte.JSX.HTMLAttributes {} -export default class Form { - $$prop_def: FormProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: "submit", cb: (event: WindowEventMap["submit"]) => void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Form extends SvelteComponentTyped< + FormProps, + { submit: WindowEventMap["submit"] }, + { default: {} } +> {} diff --git a/types/Header/Header.d.ts b/types/Header/Header.d.ts index cade4c4..efde178 100644 --- a/types/Header/Header.d.ts +++ b/types/Header/Header.d.ts @@ -1,12 +1,11 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface HeaderProps extends svelte.JSX.HTMLAttributes {} +export interface HeaderProps + extends svelte.JSX.HTMLAttributes {} -export default class Header { - $$prop_def: HeaderProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Header extends SvelteComponentTyped< + HeaderProps, + {}, + { default: {} } +> {} diff --git a/types/Label/Label.d.ts b/types/Label/Label.d.ts index a8a566e..18617ab 100644 --- a/types/Label/Label.d.ts +++ b/types/Label/Label.d.ts @@ -1,12 +1,23 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface LabelProps extends svelte.JSX.HTMLAttributes { +export interface LabelProps + extends svelte.JSX.HTMLAttributes { title?: string; /** * @default "blue" */ - color?: "blue" | "green" | "gray" | "gray-darker" | "orange"; + color?: + | "blue" + | "green" + | "gray" + | "gray-darker" + | "orange" + | "yellow" + | "red" + | "purple" + | "pink"; /** * @default false @@ -14,12 +25,8 @@ export interface LabelProps extends svelte.JSX.HTMLAttributes void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Label extends SvelteComponentTyped< + LabelProps, + { click: WindowEventMap["click"] }, + { default: {} } +> {} diff --git a/types/Label/LabelCounter.d.ts b/types/Label/LabelCounter.d.ts index c1cf73c..5cdfaa5 100644 --- a/types/Label/LabelCounter.d.ts +++ b/types/Label/LabelCounter.d.ts @@ -1,15 +1,13 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface LabelCounterProps extends svelte.JSX.HTMLAttributes { +export interface LabelCounterProps + extends svelte.JSX.HTMLAttributes { color?: "gray" | "gray-light"; } -export default class LabelCounter { - $$prop_def: LabelCounterProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class LabelCounter extends SvelteComponentTyped< + LabelCounterProps, + { click: WindowEventMap["click"] }, + { default: {} } +> {} diff --git a/types/Label/LabelDiffstat.d.ts b/types/Label/LabelDiffstat.d.ts index 04993a3..5623694 100644 --- a/types/Label/LabelDiffstat.d.ts +++ b/types/Label/LabelDiffstat.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface LabelDiffstatProps extends svelte.JSX.HTMLAttributes { +export interface LabelDiffstatProps + extends svelte.JSX.HTMLAttributes { /** * @default 3 */ @@ -22,14 +24,8 @@ export interface LabelDiffstatProps extends svelte.JSX.HTMLAttributes void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class LabelDiffstat extends SvelteComponentTyped< + LabelDiffstatProps, + { click: WindowEventMap["click"] }, + { added: {}; deleted: {}; size: {} } +> {} diff --git a/types/Label/LabelIssue.d.ts b/types/Label/LabelIssue.d.ts index 2134e46..469d6c1 100644 --- a/types/Label/LabelIssue.d.ts +++ b/types/Label/LabelIssue.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface LabelIssueProps extends svelte.JSX.HTMLAttributes { +export interface LabelIssueProps + extends svelte.JSX.HTMLAttributes { /** * @default "Label: title" */ @@ -12,12 +14,8 @@ export interface LabelIssueProps extends svelte.JSX.HTMLAttributes void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class LabelIssue extends SvelteComponentTyped< + LabelIssueProps, + { click: WindowEventMap["click"] }, + { default: {} } +> {} diff --git a/types/Label/LabelState.d.ts b/types/Label/LabelState.d.ts index bea3953..09ef463 100644 --- a/types/Label/LabelState.d.ts +++ b/types/Label/LabelState.d.ts @@ -1,15 +1,13 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface LabelStateProps extends svelte.JSX.HTMLAttributes { +export interface LabelStateProps + extends svelte.JSX.HTMLAttributes { status?: "open" | "closed" | "merged"; } -export default class LabelState { - $$prop_def: LabelStateProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class LabelState extends SvelteComponentTyped< + LabelStateProps, + { click: WindowEventMap["click"] }, + { default: {} } +> {} diff --git a/types/Loader.d.ts b/types/Loader.d.ts index 916e2b5..b418128 100644 --- a/types/Loader.d.ts +++ b/types/Loader.d.ts @@ -1,12 +1,10 @@ /// +import { SvelteComponentTyped } from "svelte"; export interface LoaderProps {} -export default class Loader { - $$prop_def: LoaderProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Loader extends SvelteComponentTyped< + LoaderProps, + {}, + { default: {} } +> {} diff --git a/types/Pagehead.d.ts b/types/Pagehead.d.ts index 7e0b712..a4ec8ef 100644 --- a/types/Pagehead.d.ts +++ b/types/Pagehead.d.ts @@ -1,13 +1,11 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface PageheadProps extends svelte.JSX.HTMLAttributes {} +export interface PageheadProps + extends svelte.JSX.HTMLAttributes {} -export default class Pagehead { - $$prop_def: PageheadProps; - $$slot_def: { - default: {}; - actions: { props: { class: "pagehead-actions" } }; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Pagehead extends SvelteComponentTyped< + PageheadProps, + {}, + { default: {}; actions: { props: { class: "pagehead-actions" } } } +> {} diff --git a/types/Pagination/Pagination.d.ts b/types/Pagination/Pagination.d.ts index 30d8c8c..ac1fc2e 100644 --- a/types/Pagination/Pagination.d.ts +++ b/types/Pagination/Pagination.d.ts @@ -1,12 +1,11 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface PaginationProps extends svelte.JSX.HTMLAttributes {} +export interface PaginationProps + extends svelte.JSX.HTMLAttributes {} -export default class Pagination { - $$prop_def: PaginationProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Pagination extends SvelteComponentTyped< + PaginationProps, + {}, + { default: {} } +> {} diff --git a/types/Popover/Popover.d.ts b/types/Popover/Popover.d.ts index 5701e3b..07829ef 100644 --- a/types/Popover/Popover.d.ts +++ b/types/Popover/Popover.d.ts @@ -1,17 +1,16 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface PopoverProps extends svelte.JSX.HTMLAttributes { +export interface PopoverProps + extends svelte.JSX.HTMLAttributes { /** * @default false */ open?: boolean; } -export default class Popover { - $$prop_def: PopoverProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Popover extends SvelteComponentTyped< + PopoverProps, + {}, + { default: {} } +> {} diff --git a/types/Progress.d.ts b/types/Progress.d.ts index 344b9b2..a23c764 100644 --- a/types/Progress.d.ts +++ b/types/Progress.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface ProgressProps extends svelte.JSX.HTMLAttributes { +export interface ProgressProps + extends svelte.JSX.HTMLAttributes { /** * Basic example: * @@ -33,11 +35,8 @@ export interface ProgressProps extends svelte.JSX.HTMLAttributes void): () => void; -} +export default class Progress extends SvelteComponentTyped< + ProgressProps, + {}, + { default: {} } +> {} diff --git a/types/SelectMenu/SelectMenu.d.ts b/types/SelectMenu/SelectMenu.d.ts index 0c52f52..65e3cb9 100644 --- a/types/SelectMenu/SelectMenu.d.ts +++ b/types/SelectMenu/SelectMenu.d.ts @@ -1,4 +1,5 @@ /// +import { SvelteComponentTyped } from "svelte"; export interface SelectMenuProps { /** @@ -22,14 +23,8 @@ export interface SelectMenuProps { align?: "left" | "right"; } -export default class SelectMenu { - $$prop_def: SelectMenuProps; - $$slot_def: { - default: {}; - filter: {}; - tabs: {}; - title: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class SelectMenu extends SvelteComponentTyped< + SelectMenuProps, + {}, + { default: {}; filter: {}; tabs: {}; title: {} } +> {} diff --git a/types/Subhead.d.ts b/types/Subhead.d.ts index bca5388..30e5a0c 100644 --- a/types/Subhead.d.ts +++ b/types/Subhead.d.ts @@ -1,4 +1,5 @@ /// +import { SvelteComponentTyped } from "svelte"; export interface SubheadProps { /** @@ -12,13 +13,12 @@ export interface SubheadProps { danger?: boolean; } -export default class Subhead { - $$prop_def: SubheadProps; - $$slot_def: { +export default class Subhead extends SvelteComponentTyped< + SubheadProps, + {}, + { actions: { props: { class: "Subhead-actions" } }; description: { props: { class: "Subhead-description" } }; heading: { props: { class: string } }; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} + } +> {} diff --git a/types/Toast.d.ts b/types/Toast.d.ts index d713b31..a7d8b4a 100644 --- a/types/Toast.d.ts +++ b/types/Toast.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface ToastProps extends svelte.JSX.HTMLAttributes { +export interface ToastProps + extends svelte.JSX.HTMLAttributes { kind?: "success" | "warning" | "error"; /** @@ -14,12 +16,8 @@ export interface ToastProps extends svelte.JSX.HTMLAttributes) => void): () => void; - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Toast extends SvelteComponentTyped< + ToastProps, + { dismiss: CustomEvent }, + { default: {} } +> {} diff --git a/types/Tooltip.d.ts b/types/Tooltip.d.ts index 261cd1e..405c54c 100644 --- a/types/Tooltip.d.ts +++ b/types/Tooltip.d.ts @@ -1,6 +1,8 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface TooltipProps extends svelte.JSX.HTMLAttributes { +export interface TooltipProps + extends svelte.JSX.HTMLAttributes { /** * @default "Tooltip text" */ @@ -29,11 +31,8 @@ export interface TooltipProps extends svelte.JSX.HTMLAttributes void): () => void; -} +export default class Tooltip extends SvelteComponentTyped< + TooltipProps, + {}, + { default: {} } +> {} diff --git a/types/Truncate.d.ts b/types/Truncate.d.ts index e148dcb..645e3f6 100644 --- a/types/Truncate.d.ts +++ b/types/Truncate.d.ts @@ -1,17 +1,16 @@ /// +import { SvelteComponentTyped } from "svelte"; -export interface TruncateProps extends svelte.JSX.HTMLAttributes { +export interface TruncateProps + extends svelte.JSX.HTMLAttributes { /** * @default false */ fixed?: boolean; } -export default class Truncate { - $$prop_def: TruncateProps; - $$slot_def: { - default: {}; - }; - - $on(eventname: string, cb: (event: Event) => void): () => void; -} +export default class Truncate extends SvelteComponentTyped< + TruncateProps, + {}, + { default: {} } +> {} From 5bd892a539420837fa4b3698222871d506170aa9 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 19 Dec 2020 15:44:07 -0800 Subject: [PATCH 6/6] build: set emitCss to false --- rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 253a82e..541f239 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -36,7 +36,7 @@ export default () => { name: UMD ? pkg.name : undefined, exports: "named", }, - plugins: [svelte(), resolve()], + plugins: [svelte({ emitCss: false }), resolve()], }; }); };