diff --git a/src/components/common/SplitbeeAnalytics.astro b/src/components/common/SplitbeeAnalytics.astro index b3c349a..66651db 100644 --- a/src/components/common/SplitbeeAnalytics.astro +++ b/src/components/common/SplitbeeAnalytics.astro @@ -3,4 +3,4 @@ const { doNotTrack = true, noCookieMode = false, url = 'https://cdn.splitbee.io/ --- - + diff --git a/src/components/ui/Background.astro b/src/components/ui/Background.astro index 791cef9..28eedf5 100644 --- a/src/components/ui/Background.astro +++ b/src/components/ui/Background.astro @@ -1,4 +1,8 @@ --- +export interface Props { + isDark?: boolean +} + const { isDark = false } = Astro.props; --- diff --git a/src/components/ui/Button.astro b/src/components/ui/Button.astro index e68e0fb..d3c2398 100644 --- a/src/components/ui/Button.astro +++ b/src/components/ui/Button.astro @@ -1,7 +1,7 @@ --- import { Icon } from 'astro-icon/components'; import { twMerge } from 'tailwind-merge'; -import type { CallToAction } from '~/types'; +import type { CallToAction as Props } from '~/types'; const { variant = 'secondary', @@ -11,7 +11,7 @@ const { class: className = '', type, ...rest -} = Astro.props as CallToAction; +} = Astro.props; const variants = { primary: 'btn-primary', diff --git a/src/components/ui/Form.astro b/src/components/ui/Form.astro index e49f6d9..276b39f 100644 --- a/src/components/ui/Form.astro +++ b/src/components/ui/Form.astro @@ -1,8 +1,8 @@ --- -import type { Form } from '~/types'; +import type { Form as Props } from '~/types'; import Button from '~/components/ui/Button.astro'; -const { inputs, textarea, disclaimer, button = 'Contact us', description = '' } = Astro.props as Form; +const { inputs, textarea, disclaimer, button = 'Contact us', description = '' } = Astro.props; ---
diff --git a/src/components/ui/Headline.astro b/src/components/ui/Headline.astro index 3e37ed1..d2646a5 100644 --- a/src/components/ui/Headline.astro +++ b/src/components/ui/Headline.astro @@ -1,5 +1,5 @@ --- -import type { Headline } from "~/types"; +import type { Headline as Props } from "~/types"; import { twMerge } from "tailwind-merge"; const { @@ -7,7 +7,7 @@ const { subtitle = await Astro.slots.render("subtitle"), tagline, classes = {}, -} = Astro.props as Headline; +} = Astro.props; const { container: containerClass = "max-w-3xl", diff --git a/src/components/ui/ItemGrid.astro b/src/components/ui/ItemGrid.astro index 03f27e8..7fc1b89 100644 --- a/src/components/ui/ItemGrid.astro +++ b/src/components/ui/ItemGrid.astro @@ -1,10 +1,10 @@ --- +import type { ItemGrid as Props } from '~/types'; import { twMerge } from 'tailwind-merge'; -import type { ItemGrid } from '~/types'; import Button from './Button.astro'; import { Icon } from 'astro-icon/components'; -const { items = [], columns, defaultIcon = '', classes = {} } = Astro.props as ItemGrid; +const { items = [], columns, defaultIcon = '', classes = {} } = Astro.props; const { container: containerClass = '', diff --git a/src/components/ui/ItemGrid2.astro b/src/components/ui/ItemGrid2.astro index 9d0bc42..f3c683b 100644 --- a/src/components/ui/ItemGrid2.astro +++ b/src/components/ui/ItemGrid2.astro @@ -1,7 +1,7 @@ --- +import type { ItemGrid as Props } from "~/types"; import { Icon } from "astro-icon/components"; import { twMerge } from "tailwind-merge"; -import type { ItemGrid } from "~/types"; import Button from "./Button.astro"; const { @@ -9,7 +9,7 @@ const { columns, defaultIcon = "", classes = {}, -} = Astro.props as ItemGrid; +} = Astro.props; const { container: containerClass = "", diff --git a/src/components/ui/WidgetWrapper.astro b/src/components/ui/WidgetWrapper.astro index b7bac38..3ae1758 100644 --- a/src/components/ui/WidgetWrapper.astro +++ b/src/components/ui/WidgetWrapper.astro @@ -1,7 +1,14 @@ --- +import type { HTMLTag } from "astro/types"; +import type { Widget } from "~/types"; import { twMerge } from "tailwind-merge"; import Background from "./Background.astro"; +export interface Props extends Widget { + containerClass?: string; + ["as"]?: HTMLTag; +} + const { id, isDark = false, containerClass = "", bg, as = "section" } = Astro.props; const WrapperTag = as; diff --git a/src/components/widgets/Brands.astro b/src/components/widgets/Brands.astro index 6f576b4..db2ad17 100644 --- a/src/components/widgets/Brands.astro +++ b/src/components/widgets/Brands.astro @@ -1,6 +1,6 @@ --- import { Icon } from 'astro-icon/components'; -import type { Brands } from '~/types'; +import type { Brands as Props } from '~/types'; import Headline from '~/components/ui/Headline.astro'; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; const { @@ -13,7 +13,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render('bg'), -} = Astro.props as Brands; +} = Astro.props; --- diff --git a/src/components/widgets/CallToAction.astro b/src/components/widgets/CallToAction.astro index e5af104..42ac30f 100644 --- a/src/components/widgets/CallToAction.astro +++ b/src/components/widgets/CallToAction.astro @@ -2,7 +2,7 @@ import WidgetWrapper from '../ui/WidgetWrapper.astro'; import type { CallToAction, Widget } from '~/types'; import Headline from '~/components/ui/Headline.astro'; -import Button from "~/components/ui/Button.astro" +import Button from '~/components/ui/Button.astro'; interface Props extends Widget { title?: string; @@ -22,7 +22,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render('bg'), -} = Astro.props as Props; +} = Astro.props; --- diff --git a/src/components/widgets/Contact.astro b/src/components/widgets/Contact.astro index 9f189b6..122f4b0 100644 --- a/src/components/widgets/Contact.astro +++ b/src/components/widgets/Contact.astro @@ -2,7 +2,7 @@ import FormContainer from '~/components/ui/Form.astro'; import Headline from '~/components/ui/Headline.astro'; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; -import type { Contact } from '~/types'; +import type { Contact as Props } from '~/types'; const { title = await Astro.slots.render('title'), @@ -18,7 +18,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render('bg'), -} = Astro.props as Contact; +} = Astro.props; --- diff --git a/src/components/widgets/Content.astro b/src/components/widgets/Content.astro index 5b95182..9ce5421 100644 --- a/src/components/widgets/Content.astro +++ b/src/components/widgets/Content.astro @@ -1,5 +1,5 @@ --- -import type { Content } from '~/types'; +import type { Content as Props } from '~/types'; import Headline from '../ui/Headline.astro'; import WidgetWrapper from '../ui/WidgetWrapper.astro'; import Image from '~/components/common/Image.astro'; @@ -22,7 +22,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render('bg'), -} = Astro.props as Content; +} = Astro.props; --- diff --git a/src/components/widgets/Features.astro b/src/components/widgets/Features.astro index fd0f64d..d7aab28 100644 --- a/src/components/widgets/Features.astro +++ b/src/components/widgets/Features.astro @@ -2,7 +2,7 @@ import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; import ItemGrid from "~/components/ui/ItemGrid.astro"; import Headline from "~/components/ui/Headline.astro"; -import type { Features } from "~/types"; +import type { Features as Props } from "~/types"; const { title = await Astro.slots.render("title"), @@ -17,7 +17,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render("bg"), -} = Astro.props as Features; +} = Astro.props; --- diff --git a/src/components/widgets/Stats.astro b/src/components/widgets/Stats.astro index b80c03b..51b1e80 100644 --- a/src/components/widgets/Stats.astro +++ b/src/components/widgets/Stats.astro @@ -1,5 +1,5 @@ --- -import type { Stats } from '~/types'; +import type { Stats as Props } from '~/types'; import WidgetWrapper from '../ui/WidgetWrapper.astro'; import Headline from '../ui/Headline.astro'; import { Icon } from 'astro-icon/components'; @@ -14,7 +14,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render('bg'), -} = Astro.props as Stats; +} = Astro.props; --- diff --git a/src/components/widgets/Steps.astro b/src/components/widgets/Steps.astro index ecc6291..160a729 100644 --- a/src/components/widgets/Steps.astro +++ b/src/components/widgets/Steps.astro @@ -3,7 +3,7 @@ import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; import Timeline from '~/components/ui/Timeline.astro'; import Headline from '~/components/ui/Headline.astro'; import Image from '~/components/common/Image.astro'; -import type { Steps } from '~/types'; +import type { Steps as Props } from '~/types'; const { title = await Astro.slots.render('title'), @@ -17,7 +17,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render('bg'), -} = Astro.props as Steps; +} = Astro.props; --- diff --git a/src/components/widgets/Steps2.astro b/src/components/widgets/Steps2.astro index b34e478..4613e84 100644 --- a/src/components/widgets/Steps2.astro +++ b/src/components/widgets/Steps2.astro @@ -3,7 +3,7 @@ import { Icon } from 'astro-icon/components'; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; import Headline from '~/components/ui/Headline.astro'; import Button from '~/components/ui/Button.astro'; -import type { Steps } from '~/types'; +import type { Steps as Props } from '~/types'; const { title = await Astro.slots.render('title'), @@ -17,7 +17,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render('bg'), -} = Astro.props as Steps; +} = Astro.props; --- diff --git a/src/components/widgets/Testimonials.astro b/src/components/widgets/Testimonials.astro index 57b2a7c..f40db05 100644 --- a/src/components/widgets/Testimonials.astro +++ b/src/components/widgets/Testimonials.astro @@ -3,7 +3,7 @@ import Headline from '~/components/ui/Headline.astro'; import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; import Button from '~/components/ui/Button.astro'; import Image from '~/components/common/Image.astro'; -import type { Testimonials } from '~/types'; +import type { Testimonials as Props } from '~/types'; const { @@ -17,7 +17,7 @@ const { isDark = false, classes = {}, bg = await Astro.slots.render('bg'), -} = Astro.props as Testimonials; +} = Astro.props; --- diff --git a/src/types.d.ts b/src/types.d.ts index 36fa40a..1cdc35f 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -122,7 +122,7 @@ interface Social { } export interface Stat { - amount?: number; + amount?: number | string; title?: string; icon?: string; } @@ -140,7 +140,7 @@ export interface Price { title?: string; subtitle?: string; description?: string; - price?: number; + price?: number | string; period?: string; items?: Array; callToAction?: CallToAction; @@ -166,7 +166,7 @@ export interface Input { export interface Textarea { label?: string; - name: string; + name?: string; placeholder?: string; rows?: number; } @@ -176,7 +176,7 @@ export interface Disclaimer { } // COMPONENTS -export interface CallToAction extends HTMLAttributes { +export interface CallToAction extends Omit, 'slot'> { variant?: 'primary' | 'secondary' | 'tertiary' | 'link'; text?: string; icon?: string; @@ -241,8 +241,8 @@ export interface Brands extends Headline, Widget { export interface Features extends Headline, Widget { image?: string | unknown; video?: Video; - items: Array; - columns: number; + items?: Array; + columns?: number; defaultIcon?: string; callToAction1?: CallToAction; callToAction2?: CallToAction;