fulldev-ui 0.3.36 → 0.4.0-beta.1
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/.github/ISSUE_TEMPLATE/bug_report.yml +57 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +39 -0
- package/.github/pull_request_template.md +23 -0
- package/.github/workflows/github-releases-to-discord.yml +21 -0
- package/.prettierignore +15 -0
- package/.prettierrc.yaml +34 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +11 -0
- package/.vscode/settings.json +23 -0
- package/CHANGELOG.md +100 -0
- package/CONTRIBUTING.md +102 -0
- package/LICENCE +21 -0
- package/README.md +9 -7
- package/astro.config.ts +44 -0
- package/package.json +42 -27
- package/pnpm-lock.yaml +5515 -0
- package/public/favicon/android-chrome-192x192.png +0 -0
- package/public/favicon/android-chrome-512x512.png +0 -0
- package/public/favicon/apple-touch-icon.png +0 -0
- package/public/favicon/browserconfig.xml +9 -0
- package/public/favicon/favicon-16x16.png +0 -0
- package/public/favicon/favicon-32x32.png +0 -0
- package/public/favicon/favicon.ico +0 -0
- package/public/favicon/mstile-150x150.png +0 -0
- package/public/favicon/safari-pinned-tab.svg +17 -0
- package/public/favicon/site.webmanifest +19 -0
- package/public/images/avatar-placeholder.jpg +0 -0
- package/public/images/avatars/1.jpeg +0 -0
- package/public/images/avatars/2.jpeg +0 -0
- package/public/images/avatars/3.jpeg +0 -0
- package/public/images/avatars/300/1.jpeg +0 -0
- package/public/images/avatars/300/2.jpeg +0 -0
- package/public/images/avatars/300/3.jpeg +0 -0
- package/public/images/avatars/300/4.jpeg +0 -0
- package/public/images/avatars/4.jpeg +0 -0
- package/public/images/avatars/5.jpeg +0 -0
- package/public/images/avatars/500/1.jpeg +0 -0
- package/public/images/avatars/500/2.jpeg +0 -0
- package/public/images/avatars/500/3.jpeg +0 -0
- package/public/images/avatars/500/4.jpeg +0 -0
- package/public/images/avatars/6.jpeg +0 -0
- package/public/images/avatars/7.jpeg +0 -0
- package/public/images/avatars/8.jpeg +0 -0
- package/public/images/block-code.png +0 -0
- package/public/images/blocks/colleagues.png +0 -0
- package/public/images/blocks/content.png +0 -0
- package/public/images/blocks/cta.png +0 -0
- package/public/images/blocks/features.png +0 -0
- package/public/images/blocks/footer.png +0 -0
- package/public/images/blocks/header.png +0 -0
- package/public/images/blocks/hero.png +0 -0
- package/public/images/blocks/intro.png +0 -0
- package/public/images/blocks/posts.png +0 -0
- package/public/images/blocks/prices.png +0 -0
- package/public/images/blocks/reviews.png +0 -0
- package/public/images/component-code.png +0 -0
- package/public/images/logo-placeholder.svg +1 -0
- package/public/images/placeholder-center.webp +0 -0
- package/public/images/placeholder-landscape-dark.png +0 -0
- package/public/images/placeholder-landscape.webp +0 -0
- package/public/images/placeholder-portrait.webp +0 -0
- package/public/images/placeholder-right.webp +0 -0
- package/public/images/placeholder.webp +0 -0
- package/siteicon.png +0 -0
- package/src/blocks/Categories.astro +12 -0
- package/src/blocks/Colleagues.astro +12 -0
- package/src/blocks/Contact.astro +152 -0
- package/src/blocks/Content.astro +12 -0
- package/src/blocks/Cta.astro +14 -0
- package/src/blocks/Features.astro +11 -0
- package/src/blocks/Footer.astro +7 -0
- package/src/blocks/Header.astro +7 -0
- package/src/blocks/Hero.astro +16 -0
- package/src/blocks/Intro.astro +19 -0
- package/src/blocks/Jobs.astro +12 -0
- package/src/blocks/Posts.astro +11 -0
- package/src/blocks/Prices.astro +22 -0
- package/src/blocks/Product.astro +64 -0
- package/src/blocks/Products.astro +11 -0
- package/src/blocks/Reviews.astro +13 -0
- package/src/components/{base/Avatar.astro → Avatar.astro} +7 -11
- package/src/components/{base/Badge.astro → Badge.astro} +36 -22
- package/src/components/{structure/Bento.astro → Bento.astro} +6 -9
- package/src/components/Block.astro +157 -0
- package/src/components/Blocks.astro +5 -0
- package/src/components/Box.astro +60 -0
- package/src/components/Button.astro +140 -0
- package/src/components/Card.astro +212 -0
- package/src/components/{structure/Carousel.astro → Carousel.astro} +13 -16
- package/src/components/Checkbox.astro +63 -0
- package/src/components/{structure/Column.astro → Column.astro} +14 -9
- package/src/components/Dialog.astro +65 -0
- package/src/components/Drawer.astro +99 -0
- package/src/components/Footer.astro +144 -0
- package/src/components/{structure/Grid.astro → Grid.astro} +7 -10
- package/src/components/Head.astro +85 -0
- package/src/components/Header.astro +204 -0
- package/src/components/Heading.astro +79 -0
- package/src/components/{base/Icon.astro → Icon.astro} +7 -9
- package/src/components/{base/Image.astro → Image.astro} +32 -30
- package/src/components/Input.astro +119 -0
- package/src/components/{typography/Label.astro → Label.astro} +12 -12
- package/src/components/{typography/Link.astro → Link.astro} +15 -13
- package/src/components/List.astro +41 -0
- package/src/components/{structure/Masonry.astro → Masonry.astro} +9 -11
- package/src/components/Rating.astro +82 -0
- package/src/components/{_Component.astro → Root.astro} +7 -11
- package/src/components/{structure/Row.astro → Row.astro} +6 -9
- package/src/components/Search.astro +62 -0
- package/src/components/Section.astro +274 -0
- package/src/components/Select.astro +144 -0
- package/src/components/Sidebar.astro +71 -0
- package/src/components/{structure/Split.astro → Split.astro} +6 -9
- package/src/components/{structure/Spread.astro → Spread.astro} +6 -9
- package/src/components/Switch.astro +114 -0
- package/src/components/Table.astro +121 -0
- package/src/components/Tagline.astro +35 -0
- package/src/components/Text.astro +43 -0
- package/src/components/Textarea.astro +105 -0
- package/src/components/Toc.astro +52 -0
- package/src/components/{structure/Wrap.astro → Wrap.astro} +5 -10
- package/src/components/docs/DecorativeBox.astro +15 -0
- package/src/components/docs/PropsTable.astro +95 -0
- package/src/components/experimental/Channel.astro +15 -10
- package/src/components/experimental/Form.astro +34 -0
- package/src/components/experimental/Gallery.astro +180 -0
- package/src/components/experimental/GalleryVertical.astro +161 -0
- package/src/components/{base → experimental}/Logo.astro +3 -5
- package/src/components/experimental/Price.astro +17 -17
- package/src/components/experimental/Prose.astro +154 -0
- package/src/components/{base → experimental}/Video.astro +1 -1
- package/src/components/experimental/Window.astro +173 -0
- package/src/content/config.ts +16 -13
- package/src/content/pages/_changelog.mdx +10 -0
- package/src/content/pages/_segment/footer.mdx +244 -0
- package/src/content/pages/_segment/header.mdx +210 -0
- package/src/content/pages/base/_dialog.mdx +17 -0
- package/src/content/pages/base/_drawer.mdx +17 -0
- package/src/content/pages/base/_image.mdx +14 -0
- package/src/content/pages/base/_switch.mdx +33 -0
- package/src/content/pages/base/badge.mdx +70 -0
- package/src/content/pages/base/button.mdx +71 -0
- package/src/content/pages/base/card.mdx +114 -0
- package/src/content/pages/base/checkbox.mdx +43 -0
- package/src/content/pages/base/icon.mdx +54 -0
- package/src/content/pages/base/input.mdx +67 -0
- package/src/content/pages/base/rating.mdx +66 -0
- package/src/content/pages/base/section.mdx +79 -0
- package/src/content/pages/base/select.mdx +77 -0
- package/src/content/pages/base/table.mdx +133 -0
- package/src/content/pages/base/textarea.mdx +73 -0
- package/src/content/pages/blocks/_banner.mdx +13 -0
- package/src/content/pages/blocks/_categories.mdx +149 -0
- package/src/content/pages/blocks/_jobs.mdx +37 -0
- package/src/content/pages/blocks/_product.mdx +29 -0
- package/src/content/pages/blocks/_products.mdx +55 -0
- package/src/content/pages/blocks/_stats.mdx +34 -0
- package/src/content/pages/blocks/colleagues.mdx +42 -0
- package/src/content/pages/blocks/content.mdx +101 -0
- package/src/content/pages/blocks/cta.mdx +192 -0
- package/src/content/pages/blocks/features.mdx +134 -0
- package/src/content/pages/blocks/footer.mdx +71 -0
- package/src/content/pages/blocks/header.mdx +192 -0
- package/src/content/pages/blocks/hero.mdx +97 -0
- package/src/content/pages/blocks/intro.mdx +132 -0
- package/src/content/pages/blocks/posts.mdx +40 -0
- package/src/content/pages/blocks/prices.mdx +126 -0
- package/src/content/pages/blocks/reviews.mdx +249 -0
- package/src/content/pages/blocks.mdx +10 -0
- package/src/content/pages/index.mdx +65 -0
- package/src/content/pages/overview/frameworks.mdx +180 -0
- package/src/content/pages/overview/installation.mdx +20 -0
- package/src/content/pages/overview/integration.mdx +37 -0
- package/src/content/pages/overview/introduction.mdx +20 -0
- package/src/content/pages/overview/theming.mdx +83 -0
- package/src/content/pages/structure/_row.mdx +23 -0
- package/src/content/pages/structure/_wrap.mdx +25 -0
- package/src/content/pages/structure/carousel.mdx +31 -0
- package/src/content/pages/structure/column.mdx +21 -0
- package/src/content/pages/structure/grid.mdx +26 -0
- package/src/content/pages/structure/masonry.mdx +32 -0
- package/src/content/pages/structure/split.mdx +21 -0
- package/src/content/pages/structure/spread.mdx +21 -0
- package/src/content/pages/typography/_tagline.mdx +36 -0
- package/src/content/pages/typography/heading.mdx +74 -0
- package/src/content/pages/typography/label.mdx +42 -0
- package/src/content/pages/typography/link.mdx +63 -0
- package/src/content/pages/typography/list.mdx +52 -0
- package/src/content/pages/typography/text.mdx +62 -0
- package/src/content/records/record.yml +1 -0
- package/src/content/settings/base.yml +48 -0
- package/src/content/settings/components.yml +27 -0
- package/src/css/color.css +6 -67
- package/src/css/custom.css +59 -0
- package/src/css/size.css +130 -0
- package/src/css/space.css +47 -26
- package/src/css/styles.css +4 -2
- package/src/env.d.ts +1 -1
- package/src/integration/generate-colors.ts +637 -0
- package/src/integration/index.ts +158 -0
- package/src/integration/tailwind-plugin.ts +80 -0
- package/src/integration/unocss-preset.ts +84 -0
- package/src/layouts/BlockLayout.astro +24 -0
- package/src/layouts/BlockOverviewLayout.astro +39 -0
- package/src/layouts/ComponentLayout.astro +23 -0
- package/src/layouts/JobsLayout.astro +40 -0
- package/src/layouts/Layout.astro +168 -0
- package/src/layouts/OverviewLayout.astro +45 -0
- package/src/layouts/PageLayout.astro +32 -0
- package/src/layouts/PostLayout.astro +32 -0
- package/src/layouts/ProductLayout.astro +31 -0
- package/src/pages/[...page].astro +41 -0
- package/src/schemas/base.ts +81 -0
- package/src/schemas/block.ts +15 -0
- package/src/schemas/card.ts +3 -0
- package/src/schemas/page.ts +43 -0
- package/src/schemas/utils.ts +22 -0
- package/src/utils/mergeEntries.ts +28 -0
- package/tsconfig.json +10 -1
- package/.astro/settings.json +0 -5
- package/.astro/types.d.ts +0 -147
- package/.env +0 -1
- package/astro.config.mjs +0 -6
- package/src/components/_Block.astro +0 -20
- package/src/components/_Blocks.astro +0 -11
- package/src/components/_Children.astro +0 -31
- package/src/components/_archive/Body.astro +0 -37
- package/src/components/_archive/Main.astro +0 -28
- package/src/components/_archive/Nav.astro +0 -50
- package/src/components/_todo/Form.astro +0 -36
- package/src/components/_todo/Prose.astro +0 -139
- package/src/components/_todo/Writeup.astro +0 -24
- package/src/components/base/Button.astro +0 -123
- package/src/components/base/Rating.astro +0 -47
- package/src/components/base/checkbox/Checkbox.astro +0 -52
- package/src/components/base/checkbox/CheckboxElement.astro +0 -31
- package/src/components/base/input/Input.astro +0 -79
- package/src/components/base/input/InputElement.astro +0 -69
- package/src/components/base/radio/Radio.astro +0 -66
- package/src/components/base/radio/RadioElement.astro +0 -34
- package/src/components/base/select/Select.astro +0 -90
- package/src/components/base/select/SelectElement.astro +0 -56
- package/src/components/base/select/SelectOption.astro +0 -32
- package/src/components/base/switch/Switch.astro +0 -55
- package/src/components/base/switch/SwitchElement.astro +0 -84
- package/src/components/base/table/Table.astro +0 -57
- package/src/components/base/table/TableBody.astro +0 -38
- package/src/components/base/table/TableCell.astro +0 -30
- package/src/components/base/table/TableFooter.astro +0 -48
- package/src/components/base/table/TableHead.astro +0 -31
- package/src/components/base/table/TableHeader.astro +0 -44
- package/src/components/base/table/TableRow.astro +0 -46
- package/src/components/base/textarea/Textarea.astro +0 -79
- package/src/components/base/textarea/TextareaElement.astro +0 -68
- package/src/components/segment/Box.astro +0 -46
- package/src/components/segment/Card.astro +0 -114
- package/src/components/segment/Footer.astro +0 -94
- package/src/components/segment/Header.astro +0 -100
- package/src/components/segment/Section.astro +0 -103
- package/src/components/segment/_regels.md +0 -32
- package/src/components/typography/Heading.astro +0 -66
- package/src/components/typography/List.astro +0 -47
- package/src/components/typography/ListItem.astro +0 -36
- package/src/components/typography/Paragraph.astro +0 -36
- package/src/components/typography/Tagline.astro +0 -36
- package/src/components/typography/Text.astro +0 -37
- package/src/components/utility/Head.astro +0 -83
- package/src/components/utility/Layout.astro +0 -46
- package/src/content/pages/index.md +0 -2
- package/src/css/color.scss +0 -289
- package/src/css/size.scss +0 -296
- package/src/css/utils.scss +0 -16
- package/src/index.ts +0 -71
- package/src/integration/integration.ts +0 -88
- package/src/integration/tailwind.ts +0 -34
- package/src/integration/unocss.ts +0 -38
- /package/src/{_archive → utils/_archive}/Childmorphic.ts +0 -0
- /package/src/{_archive → utils/_archive}/getAllCollections.ts +0 -0
- /package/src/{_archive → utils/_archive}/getCollectionCascade.ts +0 -0
- /package/src/{_archive → utils/_archive}/getPathname.ts +0 -0
- /package/src/{_archive → utils/_archive}/staticPageSchema.ts +0 -0
- /package/src/{_archive → utils/_archive}/transform/transform.ts +0 -0
- /package/src/{_archive → utils/_archive}/transform/transformCasing.ts +0 -0
- /package/src/{_archive → utils/_archive}/transform/transformReferences.ts +0 -0
- /package/src/{_archive → utils/_archive}/transform/transformSelfs.ts +0 -0
- /package/src/{_archive → utils/_archive}/transform/transformUnderscores.ts +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Column from 'fulldev-ui/components/Column.astro'
|
|
3
|
+
import Link from 'fulldev-ui/components/Link.astro'
|
|
4
|
+
import Heading from './Heading.astro'
|
|
5
|
+
|
|
6
|
+
const { toc, headings } = Astro.props
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<Column
|
|
10
|
+
class:list="toc"
|
|
11
|
+
as="aside"
|
|
12
|
+
>
|
|
13
|
+
{
|
|
14
|
+
toc?.length && headings?.length > 0 && (
|
|
15
|
+
<>
|
|
16
|
+
<Heading
|
|
17
|
+
text="On this page"
|
|
18
|
+
level={6}
|
|
19
|
+
/>
|
|
20
|
+
{headings.map(
|
|
21
|
+
(heading: { slug: string; depth: number; text: string }) => (
|
|
22
|
+
<Link
|
|
23
|
+
href={`#${heading.slug}`}
|
|
24
|
+
class="toc-link"
|
|
25
|
+
text={heading.text}
|
|
26
|
+
/>
|
|
27
|
+
)
|
|
28
|
+
)}
|
|
29
|
+
</>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
</Column>
|
|
33
|
+
|
|
34
|
+
<style lang="scss" is:global>
|
|
35
|
+
.toc {
|
|
36
|
+
display: none !important;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
border-left: 1px solid var(--color-a6);
|
|
39
|
+
padding: var(--space-6) 0 var(--space-6) min(var(--space-5), var(--gutter));
|
|
40
|
+
height: 100vh;
|
|
41
|
+
max-height: 100vh;
|
|
42
|
+
overflow-y: auto;
|
|
43
|
+
|
|
44
|
+
.toc-link {
|
|
45
|
+
font-size: var(--text-2);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (min-width: 1024px) {
|
|
49
|
+
display: flex !important;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types'
|
|
3
|
-
import
|
|
3
|
+
import Root from 'fulldev-ui/components/Root.astro'
|
|
4
4
|
|
|
5
5
|
type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
|
|
6
|
-
color?: 'base' | 'brand'
|
|
7
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
8
|
-
compact?: boolean
|
|
9
6
|
align?: 'start' | 'center' | 'end'
|
|
10
7
|
}
|
|
11
8
|
|
|
12
9
|
const { align = 'center', ...rest } = Astro.props
|
|
13
10
|
---
|
|
14
11
|
|
|
15
|
-
<
|
|
16
|
-
class:list=
|
|
12
|
+
<Root
|
|
13
|
+
class:list="wrap"
|
|
17
14
|
{align}
|
|
18
15
|
{...rest}
|
|
19
16
|
>
|
|
20
17
|
<slot />
|
|
21
|
-
</
|
|
18
|
+
</Root>
|
|
22
19
|
|
|
23
20
|
<style is:global lang="scss">
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
@include component('wrap') {
|
|
21
|
+
.wrap {
|
|
27
22
|
display: flex;
|
|
28
23
|
flex-wrap: wrap;
|
|
29
24
|
justify-content: stretch;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Table from 'fulldev-ui/components/Table.astro'
|
|
3
|
+
import { readFileSync } from 'node:fs'
|
|
4
|
+
|
|
5
|
+
const pathnameWithoutTrailingSlash = Astro.url.pathname.replace(/\/$/, '')
|
|
6
|
+
const slug = pathnameWithoutTrailingSlash.split('/').pop() || ''
|
|
7
|
+
const component = slug.charAt(0).toUpperCase() + slug.slice(1)
|
|
8
|
+
|
|
9
|
+
const allComponents = await Astro.glob('../../components/**/*.astro')
|
|
10
|
+
const found = allComponents.find(
|
|
11
|
+
(c) => c.file.split('/').pop()?.replace('.astro', '') === component
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
if (!found) return
|
|
15
|
+
|
|
16
|
+
const componentFileContent = readFileSync(found.file, 'utf-8')
|
|
17
|
+
|
|
18
|
+
const extractProps = (content: string) => {
|
|
19
|
+
const propsMatch = content.match(
|
|
20
|
+
/type Props(?:<[^>]+>)?\s*=\s*(?:HTMLAttributes<'[^']+'>\s*&\s*)?(?:Polymorphic<[^>]+>\s*&\s*)?([\s\S]*?)(?:}|$)/
|
|
21
|
+
)
|
|
22
|
+
if (propsMatch) {
|
|
23
|
+
const propsContent = propsMatch[1]
|
|
24
|
+
const props = [
|
|
25
|
+
...propsContent.matchAll(/(\w+)(?:\??:\s*((?:[^;\n]|\n\s*\|)*)|,)/g),
|
|
26
|
+
].map(([, name, type]) => ({
|
|
27
|
+
name,
|
|
28
|
+
type: type
|
|
29
|
+
? type
|
|
30
|
+
.replace(/^\s*\|\s*/, '')
|
|
31
|
+
.trim()
|
|
32
|
+
.replace(/\n\s*\|/g, ' | ')
|
|
33
|
+
: 'unknown',
|
|
34
|
+
}))
|
|
35
|
+
return props
|
|
36
|
+
}
|
|
37
|
+
return []
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const extractDefaultProps = (content: string) => {
|
|
41
|
+
const defaultPropsMatch = content.match(
|
|
42
|
+
/const\s*{[\s\S]*?}\s*=\s*Astro\.props/
|
|
43
|
+
)
|
|
44
|
+
return defaultPropsMatch
|
|
45
|
+
? [
|
|
46
|
+
...defaultPropsMatch[0].matchAll(
|
|
47
|
+
/(\w+)\s*=\s*('[^']*'|"[^"]*"|[^,\n]+)/g
|
|
48
|
+
),
|
|
49
|
+
].reduce(
|
|
50
|
+
(acc, [, name, value]) => {
|
|
51
|
+
acc[name] =
|
|
52
|
+
value.startsWith("'") || value.startsWith('"')
|
|
53
|
+
? value.slice(1, -1)
|
|
54
|
+
: value
|
|
55
|
+
return acc
|
|
56
|
+
},
|
|
57
|
+
{} as Record<string, string>
|
|
58
|
+
)
|
|
59
|
+
: {}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const extractAsDefault = (content: string) => {
|
|
63
|
+
const asDefaultMatch = content.match(/as\s*=\s*([^,\n]+)/)
|
|
64
|
+
return asDefaultMatch
|
|
65
|
+
? asDefaultMatch[1]
|
|
66
|
+
.trim()
|
|
67
|
+
.split(' : ')[0]
|
|
68
|
+
.replace(/['"]/g, '')
|
|
69
|
+
.replace(/href \? a : /, '')
|
|
70
|
+
.replace(/href \? 'a' : /, '')
|
|
71
|
+
: 'div'
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const parsedProps = extractProps(componentFileContent)
|
|
75
|
+
const parsedAstroProps = extractDefaultProps(componentFileContent)
|
|
76
|
+
const asDefault = extractAsDefault(componentFileContent)
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
<Table
|
|
80
|
+
size="md"
|
|
81
|
+
header={['Prop', 'Type', 'Default']}
|
|
82
|
+
body={[
|
|
83
|
+
...parsedProps.map((item) => [
|
|
84
|
+
item.name,
|
|
85
|
+
item.type,
|
|
86
|
+
parsedAstroProps[item.name] ?? '-',
|
|
87
|
+
]),
|
|
88
|
+
...(asDefault !== 'div'
|
|
89
|
+
? [
|
|
90
|
+
['as', 'HTMLTag', asDefault],
|
|
91
|
+
['HTML Attributes', `Polymorphic<${asDefault}>`, '-'],
|
|
92
|
+
]
|
|
93
|
+
: []),
|
|
94
|
+
]}
|
|
95
|
+
/>
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types'
|
|
3
|
-
import
|
|
3
|
+
import Button from 'fulldev-ui/components/Button.astro'
|
|
4
|
+
import Column from 'fulldev-ui/components/Column.astro'
|
|
5
|
+
import Heading from 'fulldev-ui/components/Heading.astro'
|
|
6
|
+
import Text from 'fulldev-ui/components/Text.astro'
|
|
7
|
+
import Root from '../Root.astro'
|
|
4
8
|
|
|
5
9
|
type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
|
|
6
10
|
if?: any
|
|
7
|
-
size?: '
|
|
11
|
+
size?: 'sm' | 'md' | 'lg'
|
|
8
12
|
color?: 'base' | 'brand'
|
|
9
|
-
variant?: '
|
|
13
|
+
variant?: 'primary' | 'secondary' | 'tertiary'
|
|
10
14
|
structure?: 'row' | 'column'
|
|
11
15
|
level?: 1 | 2 | 3 | 4 | 5 | 6
|
|
12
|
-
compact?: boolean
|
|
13
16
|
heading?: string
|
|
14
17
|
text?: string
|
|
15
18
|
icon?: string
|
|
@@ -18,10 +21,9 @@ type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
|
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
const {
|
|
21
|
-
variant = '
|
|
24
|
+
variant = 'secondary',
|
|
22
25
|
structure = 'row',
|
|
23
26
|
color = 'brand',
|
|
24
|
-
compact = true,
|
|
25
27
|
level = 5,
|
|
26
28
|
heading,
|
|
27
29
|
target,
|
|
@@ -32,7 +34,7 @@ const {
|
|
|
32
34
|
} = Astro.props
|
|
33
35
|
---
|
|
34
36
|
|
|
35
|
-
<
|
|
37
|
+
<Root
|
|
36
38
|
class:list={'channel'}
|
|
37
39
|
{structure}
|
|
38
40
|
{...rest}
|
|
@@ -47,11 +49,14 @@ const {
|
|
|
47
49
|
<Column>
|
|
48
50
|
<Heading
|
|
49
51
|
{level}
|
|
50
|
-
html={heading}
|
|
52
|
+
set:html={heading}
|
|
53
|
+
/>
|
|
54
|
+
<Text
|
|
55
|
+
style={{ marginTop: 'var(--space-1)' }}
|
|
56
|
+
set:html={text}
|
|
51
57
|
/>
|
|
52
|
-
<Text html={text} />
|
|
53
58
|
</Column>
|
|
54
|
-
</
|
|
59
|
+
</Root>
|
|
55
60
|
|
|
56
61
|
<style>
|
|
57
62
|
.channel {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types'
|
|
3
|
+
import Root from 'fulldev-ui/components/Root.astro'
|
|
4
|
+
|
|
5
|
+
type Props<As extends HTMLTag = 'form'> = Polymorphic<{ as: As }> & {
|
|
6
|
+
structure?: 'column' | 'row' | 'group'
|
|
7
|
+
space?: 'none' | 'auto'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
as = 'form',
|
|
12
|
+
space = 'auto',
|
|
13
|
+
structure = 'column',
|
|
14
|
+
...rest
|
|
15
|
+
} = Astro.props
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<Root
|
|
19
|
+
class:list="form"
|
|
20
|
+
{as}
|
|
21
|
+
{structure}
|
|
22
|
+
{space}
|
|
23
|
+
{...rest}
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</Root>
|
|
27
|
+
|
|
28
|
+
<style is:global lang="scss">
|
|
29
|
+
.form {
|
|
30
|
+
display: flex;
|
|
31
|
+
width: 100%;
|
|
32
|
+
max-width: calc(var(--space-4) * 44);
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Icon from 'fulldev-ui/components/Icon.astro'
|
|
3
|
+
import Image from 'fulldev-ui/components/Image.astro'
|
|
4
|
+
|
|
5
|
+
const { images, direction } = Astro.props
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
const carousel = document.querySelector('.gallery .large-carousel')
|
|
10
|
+
const icon = document.querySelector('.gallery .icon')
|
|
11
|
+
const smallImages = document.querySelectorAll('.gallery .small-image')
|
|
12
|
+
|
|
13
|
+
carousel &&
|
|
14
|
+
icon?.addEventListener('click', () => {
|
|
15
|
+
const carouselWidth = (carousel as HTMLElement).offsetWidth
|
|
16
|
+
const currentScroll = carousel.scrollLeft
|
|
17
|
+
const maxScroll = carousel.scrollWidth - carouselWidth
|
|
18
|
+
|
|
19
|
+
let scrollAmount = currentScroll + carouselWidth
|
|
20
|
+
if (scrollAmount > maxScroll) {
|
|
21
|
+
scrollAmount = 0 // Reset to beginning if we're at the end
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
carousel.scrollTo({
|
|
25
|
+
left: scrollAmount,
|
|
26
|
+
behavior: 'smooth',
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
carousel &&
|
|
31
|
+
smallImages?.forEach((image, i) => {
|
|
32
|
+
image.addEventListener('click', () => {
|
|
33
|
+
const imageWidth = (carousel as HTMLElement).offsetWidth
|
|
34
|
+
carousel.scrollTo({
|
|
35
|
+
left: i * imageWidth,
|
|
36
|
+
behavior: 'smooth',
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div
|
|
43
|
+
class:list={[
|
|
44
|
+
'full',
|
|
45
|
+
'gallery',
|
|
46
|
+
{
|
|
47
|
+
[`direction-${direction}`]: direction,
|
|
48
|
+
},
|
|
49
|
+
]}
|
|
50
|
+
>
|
|
51
|
+
<div class="large-container">
|
|
52
|
+
<div class="large-carousel">
|
|
53
|
+
{
|
|
54
|
+
images?.map((image: any) => (
|
|
55
|
+
<Image
|
|
56
|
+
class="large-image"
|
|
57
|
+
src={image}
|
|
58
|
+
/>
|
|
59
|
+
))
|
|
60
|
+
}
|
|
61
|
+
</div>
|
|
62
|
+
{
|
|
63
|
+
images?.length > 1 && (
|
|
64
|
+
<Icon
|
|
65
|
+
class="icon"
|
|
66
|
+
name="swipe-left"
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
</div>
|
|
71
|
+
<div class="small-carousel">
|
|
72
|
+
{
|
|
73
|
+
images?.length > 1 &&
|
|
74
|
+
images.map((image: any) => (
|
|
75
|
+
<Image
|
|
76
|
+
class="small-image"
|
|
77
|
+
src={image}
|
|
78
|
+
/>
|
|
79
|
+
))
|
|
80
|
+
}
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<style is:global lang="scss">
|
|
85
|
+
.gallery {
|
|
86
|
+
display: flex;
|
|
87
|
+
position: relative;
|
|
88
|
+
column-gap: var(--space-4);
|
|
89
|
+
row-gap: var(--space-1);
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
|
|
92
|
+
@media (min-width: 1024px) {
|
|
93
|
+
flex-direction: row-reverse;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.large-container {
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: space-between;
|
|
99
|
+
align-items: center;
|
|
100
|
+
|
|
101
|
+
&:hover .icon {
|
|
102
|
+
opacity: 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.icon {
|
|
106
|
+
position: absolute;
|
|
107
|
+
right: var(--space-3);
|
|
108
|
+
opacity: 0.5;
|
|
109
|
+
animation: swipe-icon 1.6s ease-in-out infinite;
|
|
110
|
+
transition: opacity 0.2s ease-in-out;
|
|
111
|
+
font-size: calc(var(--text-2) * 1.7);
|
|
112
|
+
|
|
113
|
+
@media (min-width: 1024px) {
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@keyframes swipe-icon {
|
|
119
|
+
0%,
|
|
120
|
+
100% {
|
|
121
|
+
right: var(--space-3);
|
|
122
|
+
}
|
|
123
|
+
50% {
|
|
124
|
+
right: calc(var(--space-3) * 2);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.small-carousel,
|
|
130
|
+
.large-carousel {
|
|
131
|
+
--column-width: 100%;
|
|
132
|
+
display: flex;
|
|
133
|
+
position: relative;
|
|
134
|
+
align-items: flex-start;
|
|
135
|
+
gap: var(--space-4);
|
|
136
|
+
|
|
137
|
+
box-sizing: border-box;
|
|
138
|
+
padding-bottom: var(--space-4);
|
|
139
|
+
width: 100%;
|
|
140
|
+
overflow-x: auto;
|
|
141
|
+
scroll-behavior: smooth;
|
|
142
|
+
scroll-snap-type: x mandatory;
|
|
143
|
+
|
|
144
|
+
> .root {
|
|
145
|
+
flex-grow: 0;
|
|
146
|
+
flex-shrink: 0;
|
|
147
|
+
width: var(--column-width);
|
|
148
|
+
scroll-snap-align: center;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.position-inset {
|
|
152
|
+
margin-right: calc(var(--inner-x) * -1);
|
|
153
|
+
margin-left: calc(var(--inner-x) * -1);
|
|
154
|
+
padding-right: var(--inner-x);
|
|
155
|
+
padding-left: var(--inner-x);
|
|
156
|
+
width: calc(100% + var(--inner-x) * 2);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.small-carousel {
|
|
161
|
+
--column-width: var(--space-7);
|
|
162
|
+
|
|
163
|
+
@media (min-width: 1024px) {
|
|
164
|
+
--column-width: 100%;
|
|
165
|
+
|
|
166
|
+
flex-direction: column;
|
|
167
|
+
width: 40%;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.small-image,
|
|
172
|
+
.large-image {
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.small-image:hover {
|
|
176
|
+
opacity: 0.8;
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Icon from 'fulldev-ui/components/Icon.astro'
|
|
3
|
+
import Image from 'fulldev-ui/components/Image.astro'
|
|
4
|
+
|
|
5
|
+
const { images, direction } = Astro.props
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
const carousel = document.querySelector('.gallery .large-carousel')
|
|
10
|
+
const icon = document.querySelector('.gallery .icon')
|
|
11
|
+
const smallImages = document.querySelectorAll('.gallery .small-image')
|
|
12
|
+
|
|
13
|
+
carousel &&
|
|
14
|
+
icon?.addEventListener('click', () => {
|
|
15
|
+
const carouselWidth = (carousel as HTMLElement).offsetWidth
|
|
16
|
+
const currentScroll = carousel.scrollLeft
|
|
17
|
+
const maxScroll = carousel.scrollWidth - carouselWidth
|
|
18
|
+
|
|
19
|
+
let scrollAmount = currentScroll + carouselWidth
|
|
20
|
+
if (scrollAmount > maxScroll) {
|
|
21
|
+
scrollAmount = 0 // Reset to beginning if we're at the end
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
carousel.scrollTo({
|
|
25
|
+
left: scrollAmount,
|
|
26
|
+
behavior: 'smooth',
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
carousel &&
|
|
31
|
+
smallImages.forEach((image, i) => {
|
|
32
|
+
image.addEventListener('click', () => {
|
|
33
|
+
const imageWidth = (carousel as HTMLElement).offsetWidth
|
|
34
|
+
carousel.scrollTo({
|
|
35
|
+
left: i * imageWidth,
|
|
36
|
+
behavior: 'smooth',
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div
|
|
43
|
+
class:list={[
|
|
44
|
+
'full',
|
|
45
|
+
'gallery',
|
|
46
|
+
{
|
|
47
|
+
[`direction-${direction}`]: direction,
|
|
48
|
+
},
|
|
49
|
+
]}
|
|
50
|
+
>
|
|
51
|
+
<div class="large-container">
|
|
52
|
+
<div class="large-carousel">
|
|
53
|
+
{
|
|
54
|
+
images?.map((image: any) => (
|
|
55
|
+
<Image
|
|
56
|
+
class="large-image"
|
|
57
|
+
src={image}
|
|
58
|
+
/>
|
|
59
|
+
))
|
|
60
|
+
}
|
|
61
|
+
</div>
|
|
62
|
+
{
|
|
63
|
+
images?.length > 1 && (
|
|
64
|
+
<Icon
|
|
65
|
+
class="icon"
|
|
66
|
+
name="swipe-left"
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
</div>
|
|
71
|
+
<div class="small-carousel">
|
|
72
|
+
{
|
|
73
|
+
images?.length > 1 &&
|
|
74
|
+
images.map((image: any) => (
|
|
75
|
+
<Image
|
|
76
|
+
class="small-image"
|
|
77
|
+
src={image}
|
|
78
|
+
/>
|
|
79
|
+
))
|
|
80
|
+
}
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<style is:global lang="scss">
|
|
85
|
+
.gallery {
|
|
86
|
+
display: flex;
|
|
87
|
+
position: relative;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: var(--space-1);
|
|
90
|
+
|
|
91
|
+
.large-container {
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
align-items: center;
|
|
95
|
+
|
|
96
|
+
&:hover .icon {
|
|
97
|
+
opacity: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.icon {
|
|
101
|
+
position: absolute;
|
|
102
|
+
right: var(--space-3);
|
|
103
|
+
opacity: 0.5;
|
|
104
|
+
animation: swipe-icon 1.6s ease-in-out infinite;
|
|
105
|
+
transition: opacity 0.2s ease-in-out;
|
|
106
|
+
font-size: calc(var(--text-2) * 1.7);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@keyframes swipe-icon {
|
|
110
|
+
0%,
|
|
111
|
+
100% {
|
|
112
|
+
right: var(--space-3);
|
|
113
|
+
}
|
|
114
|
+
50% {
|
|
115
|
+
right: calc(var(--space-3) * 2);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.small-carousel,
|
|
121
|
+
.large-carousel {
|
|
122
|
+
--column-width: 100%;
|
|
123
|
+
display: flex;
|
|
124
|
+
position: relative;
|
|
125
|
+
flex-direction: row;
|
|
126
|
+
align-items: flex-start;
|
|
127
|
+
gap: var(--space-4);
|
|
128
|
+
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
padding-bottom: var(--space-4);
|
|
131
|
+
width: 100%;
|
|
132
|
+
overflow-x: auto;
|
|
133
|
+
scroll-behavior: smooth;
|
|
134
|
+
scroll-snap-type: x mandatory;
|
|
135
|
+
|
|
136
|
+
> .root {
|
|
137
|
+
flex-grow: 0;
|
|
138
|
+
flex-shrink: 0;
|
|
139
|
+
width: var(--column-width);
|
|
140
|
+
scroll-snap-align: center;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.position-inset {
|
|
144
|
+
margin-right: calc(var(--inner-x) * -1);
|
|
145
|
+
margin-left: calc(var(--inner-x) * -1);
|
|
146
|
+
padding-right: var(--inner-x);
|
|
147
|
+
padding-left: var(--inner-x);
|
|
148
|
+
width: calc(100% + var(--inner-x) * 2);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.small-carousel {
|
|
153
|
+
--column-width: var(--space-7);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.small-image:hover {
|
|
157
|
+
opacity: 0.8;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { ComponentProps } from 'astro/types'
|
|
3
|
-
import
|
|
3
|
+
import Image from 'fulldev-ui/components/Image.astro'
|
|
4
4
|
|
|
5
5
|
type Props = Omit<ComponentProps<typeof Image>, 'position' | 'frame'> & {}
|
|
6
6
|
|
|
@@ -8,14 +8,12 @@ const { ...rest } = Astro.props
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
<Image
|
|
11
|
-
class="logo"
|
|
11
|
+
class:list="logo"
|
|
12
12
|
{...rest}
|
|
13
13
|
/>
|
|
14
14
|
|
|
15
15
|
<style is:global lang="scss">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@include component('logo') {
|
|
16
|
+
.logo {
|
|
19
17
|
max-width: calc(15 * var(--space-2));
|
|
20
18
|
height: 100%;
|
|
21
19
|
object-fit: contain;
|