fulldev-ui 0.1.64
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/types.d.ts +156 -0
- package/README.md +29 -0
- package/astro.config.mjs +7 -0
- package/package.json +45 -0
- package/src/blocks/todo.md +12 -0
- package/src/components/_Block.astro +20 -0
- package/src/components/_Blocks.astro +26 -0
- package/src/components/_Children.astro +38 -0
- package/src/components/_Plural.astro +27 -0
- package/src/components/_Tag.astro +53 -0
- package/src/components/base/Badge.astro +53 -0
- package/src/components/base/Button.astro +85 -0
- package/src/components/base/Buttons.astro +15 -0
- package/src/components/base/Checkbox.astro +39 -0
- package/src/components/base/Icon.astro +46 -0
- package/src/components/base/Image.astro +123 -0
- package/src/components/base/Images.astro +15 -0
- package/src/components/base/Input.astro +52 -0
- package/src/components/base/Logo.astro +33 -0
- package/src/components/base/Radio.astro +38 -0
- package/src/components/base/Rating.astro +45 -0
- package/src/components/base/Select.astro +65 -0
- package/src/components/base/SelectOption.astro +27 -0
- package/src/components/base/Switch.astro +82 -0
- package/src/components/base/Textarea.astro +31 -0
- package/src/components/base/Video.astro +32 -0
- package/src/components/base/todo.md +8 -0
- package/src/components/typography/Heading.astro +41 -0
- package/src/components/typography/Label.astro +36 -0
- package/src/components/typography/Link.astro +38 -0
- package/src/components/typography/Links.astro +15 -0
- package/src/components/typography/List.astro +42 -0
- package/src/components/typography/ListItem.astro +30 -0
- package/src/components/typography/Paragraph.astro +38 -0
- package/src/components/typography/Tagline.astro +39 -0
- package/src/components/typography/_Typography.astro +28 -0
- package/src/components/typography/todo.md +15 -0
- package/src/components/utility/DecorativeBox.astro +22 -0
- package/src/components/utility/Head.astro +81 -0
- package/src/components/wrapper/Body.astro +32 -0
- package/src/components/wrapper/Card.astro +144 -0
- package/src/components/wrapper/Cards.astro +15 -0
- package/src/components/wrapper/Deck.astro +133 -0
- package/src/components/wrapper/Footer.astro +14 -0
- package/src/components/wrapper/Form.astro +26 -0
- package/src/components/wrapper/Group.astro +26 -0
- package/src/components/wrapper/Header.astro +76 -0
- package/src/components/wrapper/Main.astro +25 -0
- package/src/components/wrapper/Nav.astro +32 -0
- package/src/components/wrapper/Prose.astro +108 -0
- package/src/components/wrapper/Section.astro +110 -0
- package/src/components/wrapper/Sections.astro +15 -0
- package/src/components/wrapper/Writeup.astro +23 -0
- package/src/components/wrapper/_Wrapper.astro +333 -0
- package/src/components/wrapper/todo.md +20 -0
- package/src/content/pages/index.md +2 -0
- package/src/css/border.css +23 -0
- package/src/css/colors.css +328 -0
- package/src/css/font.css +15 -0
- package/src/css/main.css +4 -0
- package/src/css/reset.css +388 -0
- package/src/css/sizes.css +273 -0
- package/src/env.d.ts +2 -0
- package/src/index.ts +63 -0
- package/src/integration/integration.ts +61 -0
- package/src/layouts/Layout.astro +39 -0
- package/src/layouts/todo.md +2 -0
- package/src/schemas/attributesSchema.ts +125 -0
- package/src/schemas/htmlAttributesSchema.ts +126 -0
- package/src/schemas/pageSchema.ts +185 -0
- package/src/schemas/staticPageSchema.ts +124 -0
- package/src/types/Childmorphic.ts +8 -0
- package/src/types/Pluralmorphic.ts +7 -0
- package/src/utils/getAllCollections.ts +10 -0
- package/src/utils/getCollectionCascade.ts +33 -0
- package/src/utils/getPathname.ts +18 -0
- package/src/utils/transform/transform.ts +25 -0
- package/src/utils/transform/transformCasing.ts +24 -0
- package/src/utils/transform/transformReferences.ts +54 -0
- package/src/utils/transform/transformSelfs.ts +20 -0
- package/src/utils/transform/transformUnderscores.ts +19 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import { isString } from 'remeda'
|
|
4
|
+
import Tag from '../_Tag.astro'
|
|
5
|
+
|
|
6
|
+
interface Props extends ComponentProps<typeof Tag> {
|
|
7
|
+
position?: 'background' | 'cover' | 'panel'
|
|
8
|
+
// frame?: 'mask' | 'mask-sm'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function getAltBySrc(): string {
|
|
12
|
+
if (!isString(Astro.props.src)) return ''
|
|
13
|
+
const filename = Astro.props.src?.split('/').pop()
|
|
14
|
+
const slug = filename && filename.split('.')[0]
|
|
15
|
+
const unslugged = slug?.replace(/-/g, ' ')
|
|
16
|
+
return unslugged || ''
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
as = 'img',
|
|
21
|
+
loading = 'lazy',
|
|
22
|
+
alt = getAltBySrc(),
|
|
23
|
+
src = Astro.props.html,
|
|
24
|
+
position,
|
|
25
|
+
frame,
|
|
26
|
+
...rest
|
|
27
|
+
} = Astro.props
|
|
28
|
+
|
|
29
|
+
// function getSrc() {
|
|
30
|
+
// if (src?.startsWith('http')) return src
|
|
31
|
+
// // TODO: add eager import
|
|
32
|
+
// const images = Astro.glob('/src/assets/**/*.{jpeg,jpg,png,webp,gif}', {
|
|
33
|
+
// eager: true,
|
|
34
|
+
// })
|
|
35
|
+
// const path = ('/src/assets/' + src).replace('//', '/')
|
|
36
|
+
// const image = images[path]
|
|
37
|
+
// if (!image) console.warn(`Image not found: ${path}`)
|
|
38
|
+
// else return image
|
|
39
|
+
// }
|
|
40
|
+
|
|
41
|
+
// function getSizes() {
|
|
42
|
+
// const mapped = Object.entries(sizes).map(([key, value]) => {
|
|
43
|
+
// if (key === 'base') return value
|
|
44
|
+
// if (key === 'sm') return `(min-width: 640px) ${value}`
|
|
45
|
+
// if (key === 'md') return `(min-width: 768px) ${value}`
|
|
46
|
+
// if (key === 'lg') return `(min-width: 1024px) ${value}`
|
|
47
|
+
// if (key === 'xl') return `(min-width: 1280px) ${value}`
|
|
48
|
+
// if (key === '2xl') return `(min-width: 1536px) ${value}`
|
|
49
|
+
// })
|
|
50
|
+
// const joined = mapped.join(', ')
|
|
51
|
+
// return joined
|
|
52
|
+
// }
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
src && (
|
|
57
|
+
<Tag
|
|
58
|
+
class:list={[
|
|
59
|
+
'full-image',
|
|
60
|
+
{
|
|
61
|
+
[`full-position-${position}`]: position,
|
|
62
|
+
},
|
|
63
|
+
]}
|
|
64
|
+
if={src}
|
|
65
|
+
{src}
|
|
66
|
+
{alt}
|
|
67
|
+
{as}
|
|
68
|
+
{...rest}
|
|
69
|
+
/>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
<style is:global lang="scss">
|
|
74
|
+
.full-image {
|
|
75
|
+
display: block;
|
|
76
|
+
border-radius: var(--full-border-radius-1);
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: auto;
|
|
79
|
+
object-fit: cover;
|
|
80
|
+
|
|
81
|
+
&.full-position-background {
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: 0;
|
|
84
|
+
right: 0;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
left: 0;
|
|
87
|
+
order: 1;
|
|
88
|
+
z-index: -1;
|
|
89
|
+
|
|
90
|
+
/* TODO manier fixen zodat dit met custom classes kan */
|
|
91
|
+
border-radius: 0;
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
object-fit: cover;
|
|
95
|
+
|
|
96
|
+
~ .full-tag {
|
|
97
|
+
position: relative;
|
|
98
|
+
z-index: 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.full-position-cover {
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 100%;
|
|
105
|
+
object-fit: cover;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&.full-position-panel {
|
|
109
|
+
height: 100%;
|
|
110
|
+
object-fit: cover;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.mask-sm {
|
|
114
|
+
-webkit-mask-image: linear-gradient(to top, transparent 0%, black 30%);
|
|
115
|
+
mask-image: linear-gradient(to top, transparent 0%, black 30%);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.mask {
|
|
119
|
+
-webkit-mask-image: linear-gradient(to top, transparent 0%, black 100%);
|
|
120
|
+
mask-image: linear-gradient(to top, transparent 0%, black 100%);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import type { Pluralmorphic } from '../../types/Pluralmorphic'
|
|
4
|
+
import Plural from '../_Plural.astro'
|
|
5
|
+
import Image from './Image.astro'
|
|
6
|
+
|
|
7
|
+
type Props = Pluralmorphic<ComponentProps<typeof Image>>
|
|
8
|
+
|
|
9
|
+
const { props } = Astro
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Plural
|
|
13
|
+
component={Image}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import Tag from '../_Tag.astro'
|
|
4
|
+
|
|
5
|
+
type Props = ComponentProps<typeof Tag>
|
|
6
|
+
|
|
7
|
+
const { as = 'input', variant = 'outline', name, ...rest } = Astro.props
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<Tag
|
|
11
|
+
class:list={['full-input']}
|
|
12
|
+
if={name}
|
|
13
|
+
{name}
|
|
14
|
+
{as}
|
|
15
|
+
{variant}
|
|
16
|
+
{...rest}
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<style is:global lang="scss">
|
|
20
|
+
.full-input,
|
|
21
|
+
.full-textarea,
|
|
22
|
+
.full-select {
|
|
23
|
+
display: flex;
|
|
24
|
+
position: relative;
|
|
25
|
+
align-items: center;
|
|
26
|
+
outline: none;
|
|
27
|
+
box-shadow: inset 0 0 0 var(--full-border-width) var(--border);
|
|
28
|
+
border: 0px;
|
|
29
|
+
border-radius: var(--full-border-radius-2);
|
|
30
|
+
background-color: var(--input-background);
|
|
31
|
+
padding: var(--space-element-2);
|
|
32
|
+
width: 100%;
|
|
33
|
+
min-width: var(--element-2);
|
|
34
|
+
height: calc(var(--text-element) + 2 * var(--space-element-3));
|
|
35
|
+
color: var(--foreground);
|
|
36
|
+
font-weight: var(--full-font-weight);
|
|
37
|
+
font-size: var(--text-element);
|
|
38
|
+
line-height: 1.25;
|
|
39
|
+
font-family: var(--full-font-family);
|
|
40
|
+
|
|
41
|
+
&:focus {
|
|
42
|
+
outline: none;
|
|
43
|
+
box-shadow: inset 0 0 0 2px var(--focus);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:disabled {
|
|
47
|
+
opacity: 50%;
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLTag } from 'astro/types'
|
|
3
|
+
import Children from '../_Children.astro'
|
|
4
|
+
import Tag from '../_Tag.astro'
|
|
5
|
+
|
|
6
|
+
type Props<As extends HTMLTag = 'a'> = ComponentProps<typeof Tag<As>> &
|
|
7
|
+
ComponentProps<typeof Children>
|
|
8
|
+
|
|
9
|
+
const { as = 'a', href = '/', src, ...rest } = Astro.props
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Tag
|
|
13
|
+
class:list={['full-logo']}
|
|
14
|
+
{href}
|
|
15
|
+
{as}
|
|
16
|
+
{...rest}
|
|
17
|
+
>
|
|
18
|
+
<slot name="before" />
|
|
19
|
+
<Children {...rest} />
|
|
20
|
+
<slot />
|
|
21
|
+
</Tag>
|
|
22
|
+
|
|
23
|
+
<style is:global lang="scss">
|
|
24
|
+
.full-logo {
|
|
25
|
+
.full-image {
|
|
26
|
+
display: block !important;
|
|
27
|
+
width: auto !important;
|
|
28
|
+
height: var(--space-5) !important;
|
|
29
|
+
object-fit: contain !important;
|
|
30
|
+
color: var(--12) !important;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLTag } from 'astro/types'
|
|
3
|
+
import Tag from '../_Tag.astro'
|
|
4
|
+
|
|
5
|
+
type Props<As extends HTMLTag = 'input'> = ComponentProps<typeof Tag<As>>
|
|
6
|
+
|
|
7
|
+
const { as = 'input', type = 'radio', name, ...rest } = Astro.props
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<Tag
|
|
11
|
+
class:list={['full-radio']}
|
|
12
|
+
if={name}
|
|
13
|
+
{name}
|
|
14
|
+
{as}
|
|
15
|
+
{type}
|
|
16
|
+
{...rest}
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<style is:global lang="scss">
|
|
20
|
+
.full-radio {
|
|
21
|
+
border-width: var(--border-width);
|
|
22
|
+
border-color: var(--border-color);
|
|
23
|
+
border-radius: var(--full-border-radius-2);
|
|
24
|
+
background: var(--background);
|
|
25
|
+
accent-color: var(--10);
|
|
26
|
+
font-size: var(--text);
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
border: var(--border-color-hover);
|
|
30
|
+
background: var(--background-hover);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:active {
|
|
34
|
+
border: var(--border-color-active);
|
|
35
|
+
background: var(--background-active);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLTag } from 'astro/types'
|
|
3
|
+
import Tag from '../_Tag.astro'
|
|
4
|
+
import Icon from './Icon.astro'
|
|
5
|
+
|
|
6
|
+
type Props<As extends HTMLTag = 'div'> = ComponentProps<typeof Tag<As>> & {
|
|
7
|
+
value: number | string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { variant = 'accent', value = Astro.props.html, ...rest } = Astro.props
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<Tag
|
|
14
|
+
class:list={['full-rating']}
|
|
15
|
+
{...rest}
|
|
16
|
+
>
|
|
17
|
+
{value && [1, 2, 3, 4, 5].map(() => <Icon name="star-filled" />)}
|
|
18
|
+
</Tag>
|
|
19
|
+
|
|
20
|
+
<style is:global lang="scss">
|
|
21
|
+
.full-rating {
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: 0.75rem;
|
|
24
|
+
padding-left: 5px;
|
|
25
|
+
|
|
26
|
+
&.center {
|
|
27
|
+
padding-left: 0 !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
i {
|
|
31
|
+
--un-icon: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M0 0h24v24H0z'/%3E%3Cpath fill='currentColor' d='m8.243 7.34l-6.38.925l-.113.023a1 1 0 0 0-.44 1.684l4.622 4.499l-1.09 6.355l-.013.11a1 1 0 0 0 1.464.944l5.706-3l5.693 3l.1.046a1 1 0 0 0 1.352-1.1l-1.091-6.355l4.624-4.5l.078-.085a1 1 0 0 0-.633-1.62l-6.38-.926l-2.852-5.78a1 1 0 0 0-1.794 0z'/%3E%3C/g%3E%3C/svg%3E");
|
|
32
|
+
-webkit-mask: var(--un-icon) no-repeat;
|
|
33
|
+
mask: var(--un-icon) no-repeat;
|
|
34
|
+
-webkit-mask-size: 100% 100%;
|
|
35
|
+
mask-size: 100% 100%;
|
|
36
|
+
margin-left: -0.4em;
|
|
37
|
+
background-color: currentColor;
|
|
38
|
+
width: 1em;
|
|
39
|
+
width: 1.25em;
|
|
40
|
+
height: 1em;
|
|
41
|
+
height: 1.25em;
|
|
42
|
+
color: var(--full-accent-foreground);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, Polymorphic } from 'astro/types'
|
|
3
|
+
import { isObject } from 'radash'
|
|
4
|
+
import Tag from '../_Tag.astro'
|
|
5
|
+
import Icon from './Icon.astro'
|
|
6
|
+
import SelectOption from './SelectOption.astro'
|
|
7
|
+
|
|
8
|
+
type Props<As extends 'select'> = Polymorphic<{ as: As }> &
|
|
9
|
+
ComponentProps<typeof Tag> & {
|
|
10
|
+
options?: (ComponentProps<typeof SelectOption> | string)[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { options, ...rest } = Astro.props
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<Tag
|
|
17
|
+
as="div"
|
|
18
|
+
class="full-select-wrapper"
|
|
19
|
+
{...rest}
|
|
20
|
+
>
|
|
21
|
+
<Tag
|
|
22
|
+
as="select"
|
|
23
|
+
if={options}
|
|
24
|
+
class:list={['full-select full-input']}
|
|
25
|
+
{...rest}
|
|
26
|
+
>
|
|
27
|
+
<slot name="before" />
|
|
28
|
+
{
|
|
29
|
+
options?.map((option: any) => {
|
|
30
|
+
if (isObject(option)) return <SelectOption {...option} />
|
|
31
|
+
else return <SelectOption text={option} />
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
<slot />
|
|
35
|
+
</Tag>
|
|
36
|
+
<div class="full-select-icon-wrapper">
|
|
37
|
+
<Icon
|
|
38
|
+
class="full-select-icon"
|
|
39
|
+
name="chevron-down"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</Tag>
|
|
43
|
+
|
|
44
|
+
<style is:global lang="scss">
|
|
45
|
+
.full-select {
|
|
46
|
+
appearance: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.full-select-wrapper {
|
|
50
|
+
position: relative;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.full-select-icon-wrapper {
|
|
55
|
+
display: flex;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
right: var(--space-element-2);
|
|
59
|
+
align-items: center;
|
|
60
|
+
margin: 0 !important;
|
|
61
|
+
padding: 0;
|
|
62
|
+
height: 100%;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
4
|
+
type Props = Omit<HTMLAttributes<'option'>, 'slot'> & {
|
|
5
|
+
text?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { text, ...rest } = Astro.props
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<option
|
|
12
|
+
class:list={['full-option']}
|
|
13
|
+
{...rest}
|
|
14
|
+
>
|
|
15
|
+
{text}
|
|
16
|
+
<slot />
|
|
17
|
+
</option>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
.full-option {
|
|
21
|
+
color: var(--foreground);
|
|
22
|
+
font-weight: var(--full-font-weight);
|
|
23
|
+
font-size: var(--text-element);
|
|
24
|
+
line-height: 1;
|
|
25
|
+
font-family: var(--full-font-family);
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
|
|
3
|
+
import type { Childmorphic } from '../../types/Childmorphic'
|
|
4
|
+
import Tag from '../_Tag.astro'
|
|
5
|
+
|
|
6
|
+
type Props<As extends HTMLTag = 'span'> = Polymorphic<{ as: As }> &
|
|
7
|
+
ComponentProps<typeof Tag> &
|
|
8
|
+
Childmorphic<{
|
|
9
|
+
name?: string
|
|
10
|
+
}>
|
|
11
|
+
|
|
12
|
+
const { as = 'input', name, ...rest } = Astro.props
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<Tag
|
|
16
|
+
if={true}
|
|
17
|
+
as="label"
|
|
18
|
+
class="full-switch"
|
|
19
|
+
{...rest}
|
|
20
|
+
>
|
|
21
|
+
<input
|
|
22
|
+
name={name}
|
|
23
|
+
type="checkbox"
|
|
24
|
+
class="checkbox"
|
|
25
|
+
/>
|
|
26
|
+
<div class="checkmark"></div>
|
|
27
|
+
</Tag>
|
|
28
|
+
|
|
29
|
+
<style is:global lang="scss">
|
|
30
|
+
.full-switch {
|
|
31
|
+
display: block;
|
|
32
|
+
position: relative;
|
|
33
|
+
transition: var(--full-transition);
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
border: 1px solid var(--border);
|
|
37
|
+
border-radius: 999px;
|
|
38
|
+
background-color: var(--background);
|
|
39
|
+
padding: var(--space-1);
|
|
40
|
+
min-width: calc(
|
|
41
|
+
(var(--text-element) + 2 * var(--space-element-1) * 2) + 2 *
|
|
42
|
+
var(--space-1)
|
|
43
|
+
);
|
|
44
|
+
height: calc(var(--text-element) + 2 * var(--space-element-1));
|
|
45
|
+
|
|
46
|
+
.checkbox {
|
|
47
|
+
position: absolute;
|
|
48
|
+
opacity: 0;
|
|
49
|
+
width: 0;
|
|
50
|
+
height: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.checkmark {
|
|
54
|
+
transform: 0%;
|
|
55
|
+
transition: var(--full-transition);
|
|
56
|
+
border-radius: 999px;
|
|
57
|
+
background-color: var(--border);
|
|
58
|
+
width: 50%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.checkbox:checked ~ .checkmark {
|
|
63
|
+
transform: translateX(100%);
|
|
64
|
+
background-color: var(--primary-background);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:hover {
|
|
68
|
+
background-color: var(--hover);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:focus-visible {
|
|
72
|
+
outline: 2px solid var(--focus) !important;
|
|
73
|
+
outline-offset: 2px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:disabled {
|
|
77
|
+
opacity: 0.5;
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLTag } from 'astro/types'
|
|
3
|
+
import Tag from '../_Tag.astro'
|
|
4
|
+
|
|
5
|
+
type Props<As extends HTMLTag = 'textarea'> = ComponentProps<typeof Tag>
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
as = 'textarea',
|
|
9
|
+
rows = '5',
|
|
10
|
+
variant = 'outline',
|
|
11
|
+
name,
|
|
12
|
+
...rest
|
|
13
|
+
} = Astro.props
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<Tag
|
|
17
|
+
class:list={['full-textarea']}
|
|
18
|
+
if={name}
|
|
19
|
+
{rows}
|
|
20
|
+
{name}
|
|
21
|
+
{variant}
|
|
22
|
+
{as}
|
|
23
|
+
{...rest}
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<style is:global lang="scss">
|
|
27
|
+
.full-textarea {
|
|
28
|
+
height: calc((var(--text-element) + 2 * var(--space-element-3)) * 2);
|
|
29
|
+
resize: vertical;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
type Props = any & {
|
|
3
|
+
src: string
|
|
4
|
+
thumbnail?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const { src, thumbnail } = Astro.props
|
|
8
|
+
const youtubeId =
|
|
9
|
+
(src?.includes('youtube.com') || src?.includes('youtu.be')) &&
|
|
10
|
+
src.split('/').pop()?.split('?').shift()
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
youtubeId && !thumbnail && (
|
|
15
|
+
<iframe
|
|
16
|
+
class:list={['full-image full-video']}
|
|
17
|
+
src={`https://www.youtube.com/embed/${youtubeId}?controls=0&showinfo=0&rel=0&modestbranding=1&loop=1`}
|
|
18
|
+
title="YouTube video player"
|
|
19
|
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
|
20
|
+
allowfullscreen
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
youtubeId && thumbnail && (
|
|
27
|
+
<img
|
|
28
|
+
src={`https://img.youtube.com/vi/${youtubeId}/0.jpg`}
|
|
29
|
+
alt=""
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
|
|
3
|
+
import Typography from './_Typography.astro'
|
|
4
|
+
|
|
5
|
+
type Props<As extends HTMLTag = 'h2'> = Polymorphic<{ as: As }> &
|
|
6
|
+
Omit<ComponentProps<typeof Typography>, 'size'> & {
|
|
7
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { as = 'h2', ...rest } = Astro.props
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<Typography
|
|
14
|
+
class:list={['full-heading']}
|
|
15
|
+
{as}
|
|
16
|
+
{...rest as any}
|
|
17
|
+
>
|
|
18
|
+
<slot name="before" />
|
|
19
|
+
<slot />
|
|
20
|
+
</Typography>
|
|
21
|
+
|
|
22
|
+
<style is:global lang="scss">
|
|
23
|
+
.full-heading {
|
|
24
|
+
max-width: calc(var(--space-element-3) * 36);
|
|
25
|
+
color: var(--foreground);
|
|
26
|
+
font-weight: var(--full-heading-font-weight);
|
|
27
|
+
font-size: var(--text-heading);
|
|
28
|
+
line-height: 1.1;
|
|
29
|
+
font-family: var(--full-heading-font-family);
|
|
30
|
+
letter-spacing: -0.025em;
|
|
31
|
+
|
|
32
|
+
.full-tag + & {
|
|
33
|
+
--my-spacer: var(--space-5);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.full-tagline,
|
|
37
|
+
.full-badge + & {
|
|
38
|
+
--my-spacer: var(--space-3);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
|
|
3
|
+
import Typography from './_Typography.astro'
|
|
4
|
+
|
|
5
|
+
type Props<As extends HTMLTag = 'label'> = Polymorphic<{ as: As }> &
|
|
6
|
+
ComponentProps<typeof Typography> & {
|
|
7
|
+
variant?: 'base' | 'muted'
|
|
8
|
+
text?: string
|
|
9
|
+
html?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { as = 'label', text, html, ...rest } = Astro.props
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<Typography
|
|
16
|
+
class:list={['full-label']}
|
|
17
|
+
{as}
|
|
18
|
+
{...rest}
|
|
19
|
+
>
|
|
20
|
+
<slot name="before" />
|
|
21
|
+
<Fragment set:html={html} />
|
|
22
|
+
{text}
|
|
23
|
+
<slot />
|
|
24
|
+
</Typography>
|
|
25
|
+
|
|
26
|
+
<style is:global lang="scss">
|
|
27
|
+
.full-label {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
color: var(--foreground);
|
|
31
|
+
font-weight: var(--full-font-weight);
|
|
32
|
+
font-size: var(--text-element);
|
|
33
|
+
font-family: var(--full-font-family);
|
|
34
|
+
text-align: left;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
|
|
3
|
+
import Typography from './_Typography.astro'
|
|
4
|
+
|
|
5
|
+
type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> &
|
|
6
|
+
ComponentProps<typeof Typography>
|
|
7
|
+
|
|
8
|
+
const { as = 'a', ...rest } = Astro.props
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Typography
|
|
12
|
+
class:list={['full-link']}
|
|
13
|
+
{as}
|
|
14
|
+
{...rest}
|
|
15
|
+
>
|
|
16
|
+
<slot name="before" />
|
|
17
|
+
<slot />
|
|
18
|
+
</Typography>
|
|
19
|
+
|
|
20
|
+
<style is:global lang="scss">
|
|
21
|
+
.full-link {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: var(--space-2);
|
|
26
|
+
color: var(--foreground);
|
|
27
|
+
font-weight: var(--full-font-weight);
|
|
28
|
+
font-size: var(--text);
|
|
29
|
+
font-family: var(--full-font-family);
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
text-decoration-color: var(--border);
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
text-decoration: underline;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import type { Pluralmorphic } from '../../types/Pluralmorphic'
|
|
4
|
+
import Plural from '../_Plural.astro'
|
|
5
|
+
import Link from './Link.astro'
|
|
6
|
+
|
|
7
|
+
type Props = Pluralmorphic<ComponentProps<typeof Link>>
|
|
8
|
+
|
|
9
|
+
const { props } = Astro
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Plural
|
|
13
|
+
component={Link}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|