fulldev-ui 0.6.0-beta.2 → 0.6.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/astro.config.ts +1 -7
- package/cloudcannon.config.yml +269 -0
- package/package.json +1 -1
- package/src/blocks/Banner.astro +13 -15
- package/src/blocks/Colleagues1.astro +73 -0
- package/src/blocks/Contact1.astro +100 -0
- package/src/blocks/Content1.astro +79 -0
- package/src/blocks/Content2.astro +94 -0
- package/src/blocks/Content3.astro +70 -0
- package/src/blocks/Content4.astro +75 -0
- package/src/blocks/Cta1.astro +73 -0
- package/src/blocks/Feature1.astro +61 -0
- package/src/blocks/Features1.astro +66 -0
- package/src/blocks/Footer.astro +36 -68
- package/src/blocks/Header.astro +150 -3
- package/src/blocks/Hero1.astro +74 -0
- package/src/blocks/Intro1.astro +70 -0
- package/src/blocks/Jobs1.astro +73 -0
- package/src/blocks/Logos1.astro +55 -0
- package/src/blocks/Products1.astro +90 -0
- package/src/blocks/Reviews1.astro +79 -0
- package/src/blocks/{Hero.astro → _Hero.astro} +7 -6
- package/src/components/Badge.astro +10 -18
- package/src/components/Badges.astro +12 -35
- package/src/components/Block.astro +30 -0
- package/src/components/Blocks.astro +26 -0
- package/src/components/Button.astro +11 -25
- package/src/components/Buttons.astro +12 -43
- package/src/components/Card.astro +8 -150
- package/src/components/Cart.astro +6 -11
- package/src/components/CartSummary.astro +3 -3
- package/src/components/Channel.astro +5 -14
- package/src/components/Container.astro +25 -0
- package/src/components/Drawer.astro +55 -117
- package/src/components/DrawerOld.astro +143 -0
- package/src/components/Element.astro +2 -0
- package/src/components/Form.astro +3 -1
- package/src/components/Grid.astro +39 -0
- package/src/components/Group.astro +25 -0
- package/src/components/Head.astro +18 -32
- package/src/components/Header.astro +8 -105
- package/src/components/Heading.astro +34 -71
- package/src/components/Icon.astro +5 -4
- package/src/components/Image.astro +15 -50
- package/src/components/Layout.astro +35 -0
- package/src/components/Link.astro +12 -18
- package/src/components/Links.astro +14 -35
- package/src/components/Logo.astro +26 -15
- package/src/components/Masonry.astro +42 -0
- package/src/components/Menu.astro +17 -38
- package/src/components/Menus.astro +20 -0
- package/src/components/Navigation.astro +39 -0
- package/src/components/Panel.astro +25 -0
- package/src/components/Paragraph.astro +24 -7
- package/src/components/Price.astro +4 -4
- package/src/components/Prose.astro +47 -130
- package/src/components/Rating.astro +24 -75
- package/src/components/Search.astro +5 -4
- package/src/components/Section.astro +20 -29
- package/src/components/Sidebar.astro +18 -69
- package/src/components/Social.astro +9 -2
- package/src/components/Stack.astro +25 -0
- package/src/components/Tagline.astro +21 -31
- package/src/components/Toc.astro +22 -21
- package/src/components/Writeup.astro +33 -82
- package/src/components/_Author.astro +90 -0
- package/src/components/_Header.astro +129 -0
- package/src/components/_Image.astro +79 -0
- package/src/components/_Prose copy.astro +172 -0
- package/src/components/_Sidebar copy.astro +87 -0
- package/src/content/config.ts +2 -29
- package/src/content/layouts/base.yml +42 -80
- package/src/content/pages/categories/category.md +7 -0
- package/src/content/{docs → pages/docs}/_internationalization.mdx +1 -0
- package/src/content/{docs → pages/docs}/_using-blocks.mdx +1 -0
- package/src/content/{docs → pages/docs}/_using-presets.mdx +1 -0
- package/src/content/{docs → pages/docs}/blocks.mdx +1 -0
- package/src/content/{docs → pages/docs}/collections/images.mdx +1 -0
- package/src/content/{docs → pages/docs}/collections/pages.mdx +1 -0
- package/src/content/{docs → pages/docs}/collections/presets.mdx +1 -0
- package/src/content/{docs → pages/docs}/collections.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_card.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_dialog.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_drawer.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_localeswitcher.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_switch.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_tagline.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_toggle.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/avatar.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/badge.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/badges.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/button.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/buttons.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/channel.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/channels.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/checkbox.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/code.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/heading.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/icon.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/image.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/input.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/label.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/link.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/links.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/list.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/logo.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/menu.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/prose.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/rating.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/section.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/select.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/social.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/socials.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/switch.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/table.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/tagline.mdx +1 -0
- package/src/content/pages/docs/components/text.mdx +48 -0
- package/src/content/{docs → pages/docs}/components/textarea.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/themer.mdx +1 -0
- package/src/content/{docs → pages/docs}/components.mdx +2 -4
- package/src/content/{docs → pages/docs}/customization.mdx +1 -0
- package/src/content/{docs → pages/docs}/frameworks.mdx +1 -0
- package/src/content/{docs → pages/docs}/generating-pages.mdx +1 -0
- package/src/content/{docs → pages/docs}/index.mdx +2 -4
- package/src/content/{docs → pages/docs}/installation.mdx +1 -0
- package/src/content/{docs → pages/docs}/layouts.mdx +1 -0
- package/src/content/pages/index.mdx +20 -28
- package/src/content/{categories/mugs.md → pages/posts/post.md} +1 -1
- package/src/content/{products → pages/products}/product.md +4 -4
- package/src/css/theme.css +2 -0
- package/src/images/favicon/android-chrome-192x192.png +0 -0
- package/src/images/favicon/android-chrome-512x512.png +0 -0
- package/src/images/favicon/apple-touch-icon.png +0 -0
- package/src/images/favicon/browserconfig.xml +9 -0
- package/src/images/favicon/favicon-16x16.png +0 -0
- package/src/images/favicon/favicon-32x32.png +0 -0
- package/src/images/favicon/favicon-48x48.png +0 -0
- package/src/images/favicon/favicon.ico +0 -0
- package/src/images/favicon/favicon.svg +16 -0
- package/src/images/favicon/manifest.webmanifest +30 -0
- package/src/images/favicon/mstile-150x150.png +0 -0
- package/src/images/favicon/safari-pinned-tab.svg +16 -0
- package/src/images/favicon/yandex-browser-50x50.png +0 -0
- package/src/images/favicon/yandex-browser-manifest.json +9 -0
- package/src/integration/index.ts +48 -17
- package/src/layouts/{CategoryLayout.astro → Category.astro} +21 -15
- package/src/layouts/Doc.astro +70 -0
- package/src/layouts/Job.astro +62 -0
- package/src/layouts/Jobs.astro +72 -0
- package/src/layouts/Page.astro +29 -0
- package/src/layouts/Post.astro +52 -0
- package/src/layouts/{ProductLayout.astro → Product.astro} +25 -11
- package/src/pages/[...page].astro +36 -4
- package/src/pages/test.astro +32 -2
- package/src/schemas/components/avatar.ts +4 -1
- package/src/schemas/components/badge.ts +16 -11
- package/src/schemas/components/block.ts +61 -0
- package/src/schemas/components/button.ts +14 -19
- package/src/schemas/components/channel.ts +15 -9
- package/src/schemas/components/footer.ts +15 -14
- package/src/schemas/components/head.ts +17 -0
- package/src/schemas/components/header.ts +19 -16
- package/src/schemas/components/heading.ts +7 -1
- package/src/schemas/components/icon.ts +7 -1
- package/src/schemas/components/image.ts +38 -21
- package/src/schemas/components/link.ts +10 -16
- package/src/schemas/components/logo.ts +12 -2
- package/src/schemas/components/menu.ts +12 -13
- package/src/schemas/components/navigation.ts +10 -0
- package/src/schemas/components/paragraph.ts +9 -0
- package/src/schemas/components/price.ts +9 -0
- package/src/schemas/components/rating.ts +8 -13
- package/src/schemas/components/sidebar.ts +14 -12
- package/src/schemas/components/social.ts +16 -1
- package/src/schemas/components/tagline.ts +7 -1
- package/src/schemas/imageSchema.ts +33 -4
- package/src/schemas/page.ts +40 -0
- package/src/types/global-props.ts +0 -9
- package/src/types/{virtual-modules.d.ts → virtual.d.ts} +1 -1
- package/src/utils/getHref.ts +4 -20
- package/tailwind.config.ts +4 -0
- package/tsconfig.json +1 -3
- package/example.svelte +0 -0
- package/parent.svelte +0 -0
- package/src/App.svelte +0 -0
- package/src/blocks/Categories.astro +0 -12
- package/src/blocks/Colleagues.astro +0 -12
- package/src/blocks/Contact.astro +0 -117
- package/src/blocks/Content.astro +0 -130
- package/src/blocks/Cta.astro +0 -13
- package/src/blocks/Excerpt.astro +0 -12
- package/src/blocks/Features.astro +0 -11
- package/src/blocks/Intro.astro +0 -101
- package/src/blocks/Jobs.astro +0 -12
- package/src/blocks/Posts.astro +0 -11
- package/src/blocks/Prices.astro +0 -24
- package/src/blocks/Product.astro +0 -89
- package/src/blocks/Products.astro +0 -101
- package/src/blocks/Reviews.astro +0 -12
- package/src/blocks/_Contact.astro +0 -112
- package/src/components/CartForm.astro +0 -120
- package/src/components/CartList.astro +0 -122
- package/src/components/Lead.astro +0 -46
- package/src/components/ProductCard.astro +0 -52
- package/src/components/Text.astro +0 -43
- package/src/components/_CartList backup.astro +0 -125
- package/src/components/_CartList copy.astro +0 -213
- package/src/components/_CartListSimple.astro +0 -148
- package/src/components/sections.astro +0 -28
- package/src/content/docs/components/lead.mdx +0 -49
- package/src/content/docs/components/paragraph.mdx +0 -49
- package/src/content/layouts/docs.yml +0 -70
- package/src/layouts/DocLayout.astro +0 -17
- package/src/layouts/Layout.astro +0 -79
- package/src/layouts/PageLayout.astro +0 -20
- package/src/layouts/PostLayout.astro +0 -20
- package/src/loaders/imageLoader.ts +0 -26
- package/src/pages/[...category].astro +0 -17
- package/src/pages/[...doc].astro +0 -17
- package/src/pages/[...post].astro +0 -17
- package/src/pages/[...product].astro +0 -17
- package/src/schemas/archive/_pageSchema.ts +0 -94
- package/src/schemas/categorySchema.ts +0 -16
- package/src/schemas/components/avatars.ts +0 -4
- package/src/schemas/components/banner.ts +0 -3
- package/src/schemas/components/buttons.ts +0 -4
- package/src/schemas/components/card.ts +0 -43
- package/src/schemas/components/cards.ts +0 -4
- package/src/schemas/components/channels.ts +0 -4
- package/src/schemas/components/global.ts +0 -16
- package/src/schemas/components/links.ts +0 -4
- package/src/schemas/components/list.ts +0 -3
- package/src/schemas/components/section.ts +0 -17
- package/src/schemas/components/sections.ts +0 -3
- package/src/schemas/components/socials.ts +0 -4
- package/src/schemas/components/subheader.ts +0 -10
- package/src/schemas/components/text.ts +0 -3
- package/src/schemas/components/themer.ts +0 -3
- package/src/schemas/components/toc.ts +0 -3
- package/src/schemas/components/writeup.ts +0 -20
- package/src/schemas/docSchema.ts +0 -10
- package/src/schemas/fields/categories.ts +0 -3
- package/src/schemas/fields/description.ts +0 -3
- package/src/schemas/fields/href.ts +0 -3
- package/src/schemas/fields/image.ts +0 -24
- package/src/schemas/fields/images.ts +0 -4
- package/src/schemas/fields/order.ts +0 -3
- package/src/schemas/fields/price.ts +0 -3
- package/src/schemas/fields/products.ts +0 -5
- package/src/schemas/fields/seo.ts +0 -12
- package/src/schemas/fields/soldout.ts +0 -3
- package/src/schemas/fields/title.ts +0 -3
- package/src/schemas/fields/variants.ts +0 -3
- package/src/schemas/layoutSchema.ts +0 -28
- package/src/schemas/pageSchema.ts +0 -20
- package/src/schemas/postSchema.ts +0 -16
- package/src/schemas/productSchema.ts +0 -22
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { CollectionEntry } from 'astro:content'
|
|
3
|
-
import Button from 'fulldev-ui/components/Button.astro'
|
|
4
|
-
import Input from 'fulldev-ui/components/Input.astro'
|
|
5
|
-
import Select from 'fulldev-ui/components/Select.astro'
|
|
6
|
-
import { capitalize } from 'radash'
|
|
7
|
-
import { scope } from 'simple:scope'
|
|
8
|
-
import Element from './Element.astro'
|
|
9
|
-
import Form from './Form.astro'
|
|
10
|
-
import Price from './Price.astro'
|
|
11
|
-
|
|
12
|
-
interface Props {
|
|
13
|
-
product: CollectionEntry<'products'>
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const { slug, data } = Astro.props.product
|
|
17
|
-
|
|
18
|
-
const src = data.images?.[0]?.src || `/${data.images?.[0]?.id}`
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
<RootElement data={{ variants: Object.keys(data.variants || {}) }}>
|
|
22
|
-
<Form
|
|
23
|
-
class:list="cart-form"
|
|
24
|
-
data-target={scope('form')}
|
|
25
|
-
>
|
|
26
|
-
<Input
|
|
27
|
-
name="slug"
|
|
28
|
-
type="hidden"
|
|
29
|
-
value={slug}
|
|
30
|
-
/>
|
|
31
|
-
<Input
|
|
32
|
-
name="title"
|
|
33
|
-
type="hidden"
|
|
34
|
-
value={data.title}
|
|
35
|
-
/>
|
|
36
|
-
<Input
|
|
37
|
-
name="price"
|
|
38
|
-
type="hidden"
|
|
39
|
-
value={data.price}
|
|
40
|
-
/>
|
|
41
|
-
<Input
|
|
42
|
-
name="image"
|
|
43
|
-
type="hidden"
|
|
44
|
-
value={Astro.site && (Astro.site.href + src).replace('//', '/')}
|
|
45
|
-
/>
|
|
46
|
-
{
|
|
47
|
-
Object.entries(data.variants ?? {}).map(([key, options]) => (
|
|
48
|
-
<Select
|
|
49
|
-
name={key}
|
|
50
|
-
label={capitalize(key)}
|
|
51
|
-
name={key}
|
|
52
|
-
options={options}
|
|
53
|
-
disabled={data.soldout}
|
|
54
|
-
/>
|
|
55
|
-
))
|
|
56
|
-
}
|
|
57
|
-
<Price value={data.price} />
|
|
58
|
-
<Element class:list="inputs">
|
|
59
|
-
<Input
|
|
60
|
-
class:list="quantity-input"
|
|
61
|
-
name="quantity"
|
|
62
|
-
type="number"
|
|
63
|
-
min={1}
|
|
64
|
-
value={1}
|
|
65
|
-
/>
|
|
66
|
-
<Button
|
|
67
|
-
variant="primary"
|
|
68
|
-
type="submit"
|
|
69
|
-
class="cart-add"
|
|
70
|
-
text={data.soldout ? 'Uitverkocht' : 'Toevoegen aan winkelwagen'}
|
|
71
|
-
disabled={data.soldout}
|
|
72
|
-
/>
|
|
73
|
-
</Element>
|
|
74
|
-
</Form>
|
|
75
|
-
</RootElement>
|
|
76
|
-
|
|
77
|
-
<script>
|
|
78
|
-
import { addItem, openCart } from 'fulldev-ui/stores/cart.ts'
|
|
79
|
-
|
|
80
|
-
RootElement.ready(($, ctx) => {
|
|
81
|
-
$('form').addEventListener('submit', async (e) => {
|
|
82
|
-
if (!(e.target instanceof HTMLFormElement)) return
|
|
83
|
-
e.preventDefault()
|
|
84
|
-
|
|
85
|
-
const formData = new FormData(e.target)
|
|
86
|
-
const object = Object.fromEntries(formData.entries())
|
|
87
|
-
const formatted = {
|
|
88
|
-
slug: String(object['slug']),
|
|
89
|
-
title: String(object['title']),
|
|
90
|
-
price: Number(object['price']),
|
|
91
|
-
quantity: Number(object['quantity']),
|
|
92
|
-
image: String(object['image']),
|
|
93
|
-
variants: ctx.data.variants.map((key: string) => object[key]),
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
addItem(formatted)
|
|
97
|
-
openCart()
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
</script>
|
|
101
|
-
|
|
102
|
-
<style is:global>
|
|
103
|
-
@layer fulldev {
|
|
104
|
-
.cart-form {
|
|
105
|
-
@apply flex flex-col gap-4;
|
|
106
|
-
|
|
107
|
-
.inputs {
|
|
108
|
-
@apply flex gap-2;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.quantity-input {
|
|
112
|
-
@apply w-16;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.price-input {
|
|
116
|
-
@apply hidden;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
</style>
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import Element from 'fulldev-ui/components/Element.astro'
|
|
3
|
-
import { scope } from 'simple:scope'
|
|
4
|
-
import Button from './Button.astro'
|
|
5
|
-
import Heading from './Heading.astro'
|
|
6
|
-
import Input from './Input.astro'
|
|
7
|
-
import Price from './Price.astro'
|
|
8
|
-
|
|
9
|
-
const { ...rest } = Astro.props
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<RootElement>
|
|
13
|
-
<Element
|
|
14
|
-
data-target={scope('list')}
|
|
15
|
-
class:list={'cart-list'}
|
|
16
|
-
if={true}
|
|
17
|
-
{...rest}
|
|
18
|
-
/>
|
|
19
|
-
|
|
20
|
-
<template data-target={scope('template')}>
|
|
21
|
-
<Element class="cart-list-card">
|
|
22
|
-
<img class="image" />
|
|
23
|
-
<Element class="cart-list-card-segment">
|
|
24
|
-
<Element class="cart-list-card-content">
|
|
25
|
-
<Heading
|
|
26
|
-
if
|
|
27
|
-
level={6}
|
|
28
|
-
/>
|
|
29
|
-
<Price if />
|
|
30
|
-
</Element>
|
|
31
|
-
<Element class="cart-list-card-actions">
|
|
32
|
-
<Input
|
|
33
|
-
type="number"
|
|
34
|
-
name="quantity"
|
|
35
|
-
value={1}
|
|
36
|
-
min={0}
|
|
37
|
-
/>
|
|
38
|
-
<Button
|
|
39
|
-
type="button"
|
|
40
|
-
variant="outline"
|
|
41
|
-
icon="trash"
|
|
42
|
-
type="button"
|
|
43
|
-
/>
|
|
44
|
-
</Element>
|
|
45
|
-
</Element>
|
|
46
|
-
</Element>
|
|
47
|
-
</template>
|
|
48
|
-
</RootElement>
|
|
49
|
-
|
|
50
|
-
<script>
|
|
51
|
-
import { $cart, removeItem, updateQuantity } from 'fulldev-ui/stores/cart.ts'
|
|
52
|
-
import { formatPrice } from 'fulldev-ui/utils/cart'
|
|
53
|
-
|
|
54
|
-
RootElement.ready(($) => {
|
|
55
|
-
$cart.subscribe((items) => {
|
|
56
|
-
const list = $('list')
|
|
57
|
-
const template = $('template') as HTMLTemplateElement
|
|
58
|
-
|
|
59
|
-
// list.innerHTML = ''
|
|
60
|
-
items.forEach((item) => {
|
|
61
|
-
const clone = template?.content.cloneNode(true) as HTMLElement
|
|
62
|
-
const clonedCard = clone.querySelector('.cart-list-card') as HTMLElement
|
|
63
|
-
const existingCard = list.querySelector(`[data-slug="${item.slug}"]`)
|
|
64
|
-
const card = existingCard || (clonedCard as HTMLElement)
|
|
65
|
-
const heading = card.querySelector('.heading') as HTMLElement
|
|
66
|
-
const price = card.querySelector('.price') as HTMLElement
|
|
67
|
-
const image = card.querySelector('.image') as HTMLImageElement
|
|
68
|
-
const remove = card.querySelector('.button') as HTMLButtonElement
|
|
69
|
-
const quantity = card.querySelector('.input') as HTMLInputElement
|
|
70
|
-
|
|
71
|
-
card.dataset.slug = item.slug
|
|
72
|
-
heading.textContent = item.title
|
|
73
|
-
price.textContent = formatPrice(item.price)
|
|
74
|
-
image.src = item.image
|
|
75
|
-
|
|
76
|
-
remove.addEventListener('click', () => removeItem(item.slug))
|
|
77
|
-
|
|
78
|
-
quantity.addEventListener('change', (e) => {
|
|
79
|
-
console.log('blur')
|
|
80
|
-
const target = e.target as HTMLInputElement
|
|
81
|
-
const value = Number(target.value)
|
|
82
|
-
updateQuantity(item.slug, value)
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
$('list').appendChild(clone)
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
</script>
|
|
90
|
-
|
|
91
|
-
<style is:global>
|
|
92
|
-
@layer fulldev {
|
|
93
|
-
.cart-list {
|
|
94
|
-
@apply flex flex-col text-foreground;
|
|
95
|
-
|
|
96
|
-
.cart-list-card {
|
|
97
|
-
@apply flex w-full gap-5;
|
|
98
|
-
|
|
99
|
-
&:not(:first-child) {
|
|
100
|
-
@apply mt-5 border-t pt-5;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.image {
|
|
105
|
-
@apply block h-auto w-24;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.cart-list-card-segment {
|
|
109
|
-
@apply flex h-full w-full flex-col justify-between gap-4;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.cart-list-card-content,
|
|
113
|
-
.cart-list-card-actions {
|
|
114
|
-
@apply flex justify-between gap-2;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.input {
|
|
118
|
-
@apply w-16;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
</style>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes, HTMLTag } from 'astro/types'
|
|
3
|
-
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
|
-
import type { GlobalProps } from 'fulldev-ui/types/global-props'
|
|
5
|
-
|
|
6
|
-
interface Props extends GlobalProps, HTMLAttributes<'p'> {
|
|
7
|
-
as?: HTMLTag
|
|
8
|
-
text?: string | undefined
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const { as = 'p', text, ...rest } = Astro.props
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<Element
|
|
15
|
-
class:list="lead"
|
|
16
|
-
{as}
|
|
17
|
-
{...rest}
|
|
18
|
-
>
|
|
19
|
-
<slot />
|
|
20
|
-
<Fragment set:html={text} />
|
|
21
|
-
</Element>
|
|
22
|
-
|
|
23
|
-
<style is:global>
|
|
24
|
-
@layer fulldev {
|
|
25
|
-
.lead,
|
|
26
|
-
.prose-content h1 + p {
|
|
27
|
-
@apply text-muted-foreground;
|
|
28
|
-
|
|
29
|
-
&.size-sm {
|
|
30
|
-
@apply text-sm;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.size-md {
|
|
34
|
-
@apply text-base;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.size-lg {
|
|
38
|
-
@apply text-lg;
|
|
39
|
-
|
|
40
|
-
&:is(h1 + p) {
|
|
41
|
-
@apply text-xl;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { CollectionEntry } from 'astro:content'
|
|
3
|
-
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
|
-
import Heading from 'fulldev-ui/components/Heading.astro'
|
|
5
|
-
import Image from 'fulldev-ui/components/Image.astro'
|
|
6
|
-
import Price from 'fulldev-ui/components/Price.astro'
|
|
7
|
-
import type { ProductSchema } from 'fulldev-ui/schemas/productSchema'
|
|
8
|
-
|
|
9
|
-
interface Props extends ProductSchema {
|
|
10
|
-
slug?: CollectionEntry<'products'>['slug']
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const { slug, images, title, price, ...rest } = Astro.props
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<Element
|
|
17
|
-
class:list="product-card"
|
|
18
|
-
as="a"
|
|
19
|
-
href={`/producten/${slug}/`}
|
|
20
|
-
{...rest}
|
|
21
|
-
>
|
|
22
|
-
<Image {...images?.[0]} />
|
|
23
|
-
<Element class:list="product-card-content">
|
|
24
|
-
<Heading
|
|
25
|
-
as="h3"
|
|
26
|
-
level={5}
|
|
27
|
-
size={'sm'}
|
|
28
|
-
text={title}
|
|
29
|
-
/>
|
|
30
|
-
<Price value={price} />
|
|
31
|
-
</Element>
|
|
32
|
-
</Element>
|
|
33
|
-
|
|
34
|
-
<style is:global>
|
|
35
|
-
@layer fulldev {
|
|
36
|
-
.product-card {
|
|
37
|
-
@apply relative flex flex-col gap-3;
|
|
38
|
-
|
|
39
|
-
&:hover > .image {
|
|
40
|
-
@apply opacity-75 transition-opacity;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.image {
|
|
44
|
-
@apply rounded-md border;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.product-card-content {
|
|
48
|
-
@apply flex h-full flex-col gap-2;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
</style>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
-
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
|
-
|
|
5
|
-
interface Props extends HTMLAttributes<'p'> {
|
|
6
|
-
size?: 'sm' | 'md' | 'lg' | undefined
|
|
7
|
-
color?: 'base' | 'brand' | undefined
|
|
8
|
-
theme?: 'light' | 'dark' | undefined
|
|
9
|
-
contrast?: boolean | undefined
|
|
10
|
-
lead?: boolean | undefined
|
|
11
|
-
text?: string | undefined
|
|
12
|
-
if?: any
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const { color = 'base', text, ...rest } = Astro.props
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
<Element
|
|
19
|
-
class:list="text"
|
|
20
|
-
as="p"
|
|
21
|
-
{color}
|
|
22
|
-
{...rest}
|
|
23
|
-
>
|
|
24
|
-
<slot />
|
|
25
|
-
<Fragment set:html={text} />
|
|
26
|
-
</Element>
|
|
27
|
-
|
|
28
|
-
<style is:global>
|
|
29
|
-
@layer fulldev {
|
|
30
|
-
.text {
|
|
31
|
-
margin: 0;
|
|
32
|
-
max-width: calc(var(--space-4) * 44);
|
|
33
|
-
color: var(--color-11);
|
|
34
|
-
font-size: var(--text-3);
|
|
35
|
-
line-height: 1.625;
|
|
36
|
-
|
|
37
|
-
&.lead {
|
|
38
|
-
font-size: var(--text-4);
|
|
39
|
-
text-wrap: balance;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<!-- ---
|
|
2
|
-
import Element from 'fulldev-ui/components/Element.astro'
|
|
3
|
-
import Image from 'fulldev-ui/components/Image.astro'
|
|
4
|
-
import Button from './Button.astro'
|
|
5
|
-
import Heading from './Heading.astro'
|
|
6
|
-
import Input from './Input.astro'
|
|
7
|
-
import Price from './Price.astro'
|
|
8
|
-
|
|
9
|
-
const { ...rest } = Astro.props
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<Element
|
|
13
|
-
if={true}
|
|
14
|
-
class:list="cart-list"
|
|
15
|
-
{...rest}
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
<template id="cart-list-template">
|
|
19
|
-
<Element class="cart-list-card">
|
|
20
|
-
<Image src="/placeholder-portrait.webp" />
|
|
21
|
-
<Element class="cart-list-card-segment">
|
|
22
|
-
<Element class="cart-list-card-content">
|
|
23
|
-
<Heading
|
|
24
|
-
level={6}
|
|
25
|
-
text="Product title"
|
|
26
|
-
/>
|
|
27
|
-
<Price value={999} />
|
|
28
|
-
</Element>
|
|
29
|
-
<Element class="cart-list-card-actions">
|
|
30
|
-
<Input
|
|
31
|
-
type="number"
|
|
32
|
-
name="quantity"
|
|
33
|
-
value={1}
|
|
34
|
-
min={0}
|
|
35
|
-
/>
|
|
36
|
-
<Button
|
|
37
|
-
variant="outline"
|
|
38
|
-
icon="trash"
|
|
39
|
-
type="button"
|
|
40
|
-
/>
|
|
41
|
-
</Element>
|
|
42
|
-
</Element>
|
|
43
|
-
</Element>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<script>
|
|
47
|
-
import { $cart } from 'fulldev-ui/stores/cart.ts'
|
|
48
|
-
import { formatPrice } from 'fulldev-ui/utils/cart'
|
|
49
|
-
|
|
50
|
-
function setCards(items: any) {
|
|
51
|
-
const template = document.querySelector('template')
|
|
52
|
-
const container = document.querySelector('.cart-list')
|
|
53
|
-
if (!(container instanceof HTMLElement)) return
|
|
54
|
-
if (!(template instanceof HTMLTemplateElement)) return
|
|
55
|
-
|
|
56
|
-
container.innerHTML = ''
|
|
57
|
-
|
|
58
|
-
items.forEach((item: any, index: number) => {
|
|
59
|
-
const clone = template?.content.cloneNode(true)
|
|
60
|
-
if (!(clone instanceof DocumentFragment)) return
|
|
61
|
-
const card = clone.querySelector('.cart-list-card')
|
|
62
|
-
if (!card) return
|
|
63
|
-
|
|
64
|
-
const image = card.querySelector('img')
|
|
65
|
-
const heading = card.querySelector('.heading')
|
|
66
|
-
const price = card.querySelector('.price')
|
|
67
|
-
// const input = card.querySelector('.input-input')
|
|
68
|
-
const remove = card.querySelector('.button')
|
|
69
|
-
|
|
70
|
-
if (image) image.src = item.image
|
|
71
|
-
if (heading) heading.textContent = item.name
|
|
72
|
-
if (price) price.textContent = formatPrice(item.price)
|
|
73
|
-
|
|
74
|
-
remove?.addEventListener('click', () => {
|
|
75
|
-
const currentCart = $cart.get()
|
|
76
|
-
const newCart = [...currentCart]
|
|
77
|
-
newCart.splice(index, 1)
|
|
78
|
-
$cart.set(newCart)
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
container.appendChild(clone)
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
document.addEventListener('astro:page-load', () => {
|
|
86
|
-
setCards($cart.get())
|
|
87
|
-
|
|
88
|
-
$cart.subscribe((items: any) => {
|
|
89
|
-
setCards(items)
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
</script>
|
|
93
|
-
|
|
94
|
-
<style is:global>
|
|
95
|
-
@layer fulldev {
|
|
96
|
-
.cart-list {
|
|
97
|
-
@apply flex flex-col text-foreground;
|
|
98
|
-
|
|
99
|
-
.cart-list-card {
|
|
100
|
-
@apply flex w-full gap-5;
|
|
101
|
-
|
|
102
|
-
&:not(:first-child) {
|
|
103
|
-
@apply mt-5 border-t pt-5;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.image {
|
|
108
|
-
@apply block h-auto w-24;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.cart-list-card-segment {
|
|
112
|
-
@apply flex h-full w-full flex-col justify-between gap-4;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.cart-list-card-content,
|
|
116
|
-
.cart-list-card-actions {
|
|
117
|
-
@apply flex justify-between gap-2;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.input {
|
|
121
|
-
@apply w-16;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
</style> -->
|