From 5fdd47b435b6e52d89041003c2c19aa88d882cc6 Mon Sep 17 00:00:00 2001 From: Ryan Gossiaux Date: Fri, 18 Mar 2022 11:05:14 -0700 Subject: [PATCH] Refactor types out into types.ts file and use /// Fixes packaging problems. --- src/lib/components/dialog/Dialog.svelte | 6 +- .../components/dialog/DialogOverlay.svelte | 3 +- src/lib/components/dialog/DialogTitle.svelte | 3 +- .../components/disclosure/Disclosure.svelte | 3 +- .../disclosure/DisclosureButton.svelte | 3 +- .../disclosure/DisclosurePanel.svelte | 6 +- src/lib/components/listbox/Listbox.svelte | 3 +- .../components/listbox/ListboxButton.svelte | 3 +- .../components/listbox/ListboxLabel.svelte | 3 +- .../components/listbox/ListboxOption.svelte | 3 +- .../components/listbox/ListboxOptions.svelte | 6 +- src/lib/components/menu/Menu.svelte | 3 +- src/lib/components/menu/MenuButton.svelte | 3 +- src/lib/components/menu/MenuItem.svelte | 3 +- src/lib/components/menu/MenuItems.svelte | 6 +- src/lib/components/popover/Popover.svelte | 3 +- .../components/popover/PopoverButton.svelte | 3 +- .../components/popover/PopoverGroup.svelte | 3 +- .../components/popover/PopoverOverlay.svelte | 6 +- .../components/popover/PopoverPanel.svelte | 6 +- .../components/radio-group/RadioGroup.svelte | 3 +- .../radio-group/RadioGroupOption.svelte | 3 +- src/lib/components/switch/Switch.svelte | 3 +- src/lib/components/switch/SwitchGroup.svelte | 3 +- src/lib/components/tabs/Tab.svelte | 3 +- src/lib/components/tabs/TabGroup.svelte | 3 +- src/lib/components/tabs/TabList.svelte | 3 +- src/lib/components/tabs/TabPanel.svelte | 6 +- src/lib/components/tabs/TabPanels.svelte | 3 +- .../transitions/TransitionChild.svelte | 32 ++++--- .../transitions/TransitionChildWrapper.svelte | 3 +- .../transitions/TransitionRoot.svelte | 22 +++-- src/lib/types.ts | 89 +++++++++++++++++++ src/lib/utils/Render.svelte | 86 +----------------- 34 files changed, 179 insertions(+), 161 deletions(-) create mode 100644 src/lib/types.ts diff --git a/src/lib/components/dialog/Dialog.svelte b/src/lib/components/dialog/Dialog.svelte index 7e6e3d8..338edb9 100644 --- a/src/lib/components/dialog/Dialog.svelte +++ b/src/lib/components/dialog/Dialog.svelte @@ -74,10 +74,8 @@ import { get_current_component } from "svelte/internal"; import type { SupportedAs } from "$lib/internal/elements"; import type { HTMLActionArray } from "$lib/hooks/use-actions"; - import Render, { - Features, - type TPassThroughProps, - } from "$lib/utils/Render.svelte"; + import Render from "$lib/utils/Render.svelte"; + import { Features, type TPassThroughProps } from "$lib/types"; /***** Props *****/ type TAsProp = $$Generic; diff --git a/src/lib/components/dialog/DialogOverlay.svelte b/src/lib/components/dialog/DialogOverlay.svelte index 9a60665..81e669a 100644 --- a/src/lib/components/dialog/DialogOverlay.svelte +++ b/src/lib/components/dialog/DialogOverlay.svelte @@ -12,7 +12,8 @@ import { get_current_component } from "svelte/internal"; import type { SupportedAs } from "$lib/internal/elements"; import type { HTMLActionArray } from "$lib/hooks/use-actions"; - import Render, { type TPassThroughProps } from "$lib/utils/Render.svelte"; + import Render from "$lib/utils/Render.svelte"; + import type { TPassThroughProps } from "$lib/types"; /***** Props *****/ type TAsProp = $$Generic; diff --git a/src/lib/components/dialog/DialogTitle.svelte b/src/lib/components/dialog/DialogTitle.svelte index af6965b..dc32263 100644 --- a/src/lib/components/dialog/DialogTitle.svelte +++ b/src/lib/components/dialog/DialogTitle.svelte @@ -13,7 +13,8 @@ import { get_current_component } from "svelte/internal"; import type { SupportedAs } from "$lib/internal/elements"; import type { HTMLActionArray } from "$lib/hooks/use-actions"; - import Render, { type TPassThroughProps } from "$lib/utils/Render.svelte"; + import Render from "$lib/utils/Render.svelte"; + import type { TPassThroughProps } from "$lib/types"; /***** Props *****/ type TAsProp = $$Generic; diff --git a/src/lib/components/disclosure/Disclosure.svelte b/src/lib/components/disclosure/Disclosure.svelte index 99f4f00..65c3e16 100644 --- a/src/lib/components/disclosure/Disclosure.svelte +++ b/src/lib/components/disclosure/Disclosure.svelte @@ -58,7 +58,8 @@ import { get_current_component } from "svelte/internal"; import type { SupportedAs } from "$lib/internal/elements"; import type { HTMLActionArray } from "$lib/hooks/use-actions"; - import Render, { type TPassThroughProps } from "$lib/utils/Render.svelte"; + import Render from "$lib/utils/Render.svelte"; + import type { TPassThroughProps } from "$lib/types"; /***** Props *****/ type TAsProp = $$Generic; diff --git a/src/lib/components/disclosure/DisclosureButton.svelte b/src/lib/components/disclosure/DisclosureButton.svelte index 64683d0..440cdec 100644 --- a/src/lib/components/disclosure/DisclosureButton.svelte +++ b/src/lib/components/disclosure/DisclosureButton.svelte @@ -15,9 +15,10 @@ import { get_current_component } from "svelte/internal"; import type { SupportedAs } from "$lib/internal/elements"; import type { HTMLActionArray } from "$lib/hooks/use-actions"; - import Render, { type TPassThroughProps } from "$lib/utils/Render.svelte"; + import Render from "$lib/utils/Render.svelte"; import { writable } from "svelte/store"; import { resolveButtonType } from "$lib/utils/resolve-button-type"; + import type { TPassThroughProps } from "$lib/types"; /***** Props *****/ type TAsProp = $$Generic; diff --git a/src/lib/components/disclosure/DisclosurePanel.svelte b/src/lib/components/disclosure/DisclosurePanel.svelte index ab9b370..d8c619c 100644 --- a/src/lib/components/disclosure/DisclosurePanel.svelte +++ b/src/lib/components/disclosure/DisclosurePanel.svelte @@ -23,10 +23,8 @@ import { get_current_component } from "svelte/internal"; import type { SupportedAs } from "$lib/internal/elements"; import type { HTMLActionArray } from "$lib/hooks/use-actions"; - import Render, { - Features, - type TPassThroughProps, - } from "$lib/utils/Render.svelte"; + import Render from "$lib/utils/Render.svelte"; + import { Features, type TPassThroughProps } from "$lib/types"; /***** Props *****/ type TAsProp = $$Generic; diff --git a/src/lib/components/listbox/Listbox.svelte b/src/lib/components/listbox/Listbox.svelte index 519a6fd..c0f323d 100644 --- a/src/lib/components/listbox/Listbox.svelte +++ b/src/lib/components/listbox/Listbox.svelte @@ -78,7 +78,8 @@ import { get_current_component } from "svelte/internal"; import type { SupportedAs } from "$lib/internal/elements"; import type { HTMLActionArray } from "$lib/hooks/use-actions"; - import Render, { type TPassThroughProps } from "$lib/utils/Render.svelte"; + import Render from "$lib/utils/Render.svelte"; + import type { TPassThroughProps } from "$lib/types"; /***** Props *****/ type TAsProp = $$Generic; diff --git a/src/lib/components/listbox/ListboxButton.svelte b/src/lib/components/listbox/ListboxButton.svelte index 982b159..4d76259 100644 --- a/src/lib/components/listbox/ListboxButton.svelte +++ b/src/lib/components/listbox/ListboxButton.svelte @@ -15,8 +15,9 @@ import type { SupportedAs } from "$lib/internal/elements"; import type { HTMLActionArray } from "$lib/hooks/use-actions"; import { get_current_component } from "svelte/internal"; - import Render, { type TPassThroughProps } from "$lib/utils/Render.svelte"; + import Render from "$lib/utils/Render.svelte"; import { resolveButtonType } from "$lib/utils/resolve-button-type"; + import type { TPassThroughProps } from "$lib/types"; /***** Props *****/ type TAsProp = $$Generic; diff --git a/src/lib/components/listbox/ListboxLabel.svelte b/src/lib/components/listbox/ListboxLabel.svelte index 0087eac..0f62785 100644 --- a/src/lib/components/listbox/ListboxLabel.svelte +++ b/src/lib/components/listbox/ListboxLabel.svelte @@ -8,11 +8,12 @@