fulldev-ui 0.3.0-beta.3 → 0.3.3
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/settings.json +1 -1
- package/package.json +10 -5
- package/src/components/_Block.astro +0 -5
- package/src/components/_Component.astro +10 -8
- package/src/components/_archive/Body.astro +2 -2
- package/src/components/_archive/Nav.astro +12 -0
- package/src/components/_todo/Form.astro +1 -1
- package/src/components/_todo/Prose.astro +7 -7
- package/src/components/base/Badge.astro +20 -16
- package/src/components/base/Button.astro +21 -34
- package/src/components/base/Icon.astro +7 -7
- package/src/components/base/Image.astro +116 -42
- package/src/components/base/Logo.astro +2 -3
- package/src/components/base/Rating.astro +30 -29
- package/src/components/base/checkbox/Checkbox.astro +52 -0
- package/src/components/base/checkbox/CheckboxElement.astro +31 -0
- package/src/components/base/input/Input.astro +79 -0
- package/src/components/base/input/InputElement.astro +60 -0
- package/src/components/base/radio/Radio.astro +66 -0
- package/src/components/base/radio/RadioElement.astro +34 -0
- package/src/components/base/select/Select.astro +90 -0
- package/src/components/base/select/SelectElement.astro +56 -0
- package/src/components/base/select/SelectOption.astro +32 -0
- package/src/components/base/switch/Switch.astro +55 -0
- package/src/components/base/{Switch.astro → switch/SwitchElement.astro} +15 -13
- package/src/components/base/table/Table.astro +55 -0
- package/src/components/base/table/TableBody.astro +39 -0
- package/src/components/base/table/TableCell.astro +30 -0
- package/src/components/base/table/TableFooter.astro +48 -0
- package/src/components/base/table/TableHead.astro +31 -0
- package/src/components/base/table/TableHeader.astro +44 -0
- package/src/components/base/table/TableRow.astro +46 -0
- package/src/components/base/textarea/Textarea.astro +79 -0
- package/src/components/base/textarea/TextareaElement.astro +61 -0
- package/src/components/segment/Card.astro +42 -19
- package/src/components/segment/Footer.astro +88 -0
- package/src/components/segment/Header.astro +48 -19
- package/src/components/segment/Section.astro +66 -32
- package/src/components/segment/_regels.md +32 -0
- package/src/components/structure/Bento.astro +38 -0
- package/src/components/structure/Box.astro +30 -0
- package/src/components/structure/Carousel.astro +55 -0
- package/src/components/structure/Column.astro +46 -0
- package/src/components/structure/Grid.astro +33 -0
- package/src/components/structure/Masonry.astro +42 -0
- package/src/components/structure/Row.astro +44 -0
- package/src/components/structure/Split.astro +54 -0
- package/src/components/structure/Spread.astro +45 -0
- package/src/components/structure/Wrap.astro +44 -0
- package/src/components/typography/Heading.astro +37 -28
- package/src/components/typography/Label.astro +4 -8
- package/src/components/typography/Link.astro +40 -12
- package/src/components/typography/List.astro +12 -13
- package/src/components/typography/ListItem.astro +11 -10
- package/src/components/typography/Paragraph.astro +4 -9
- package/src/components/typography/Tagline.astro +11 -10
- package/src/components/typography/Text.astro +5 -9
- package/src/content/config.ts +1 -1
- package/src/css/color.scss +289 -0
- package/src/css/size.scss +293 -0
- package/src/css/space.scss +94 -0
- package/src/css/styles.css +1 -2
- package/src/index.ts +30 -12
- package/src/integration/tailwind.ts +34 -0
- package/src/integration/unocss.ts +38 -0
- package/src/schemas/schemas.ts +45 -0
- package/src/components/_archive/Row.astro +0 -26
- package/src/components/_todo/Footer.astro +0 -66
- package/src/components/_todo/todo.md +0 -10
- package/src/components/base/Checkbox.astro +0 -41
- package/src/components/base/Input.astro +0 -59
- package/src/components/base/Radio.astro +0 -39
- package/src/components/base/Select.astro +0 -69
- package/src/components/base/SelectOption.astro +0 -27
- package/src/components/base/Textarea.astro +0 -34
- package/src/components/base/todo.md +0 -7
- package/src/components/segment/Box.astro +0 -41
- package/src/components/segment/Deck.astro +0 -40
- package/src/components/segment/Group.astro +0 -29
- package/src/components/typography/todo.md +0 -3
- package/src/css/color.css +0 -88
- package/src/css/props/align.scss +0 -20
- package/src/css/props/frame.scss +0 -153
- package/src/css/props/mask +0 -1
- package/src/css/props/position.scss +0 -33
- package/src/css/props/ratio +0 -1
- package/src/css/props/structure.scss +0 -228
- package/src/css/props/variant.scss +0 -130
- package/src/css/radix.css +0 -281
- package/src/css/size.css +0 -334
- /package/src/schemas/{collection.ts → collection-old-schemas.ts} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
3
|
+
import { TableBody, TableFooter, TableHeader } from 'fulldev-ui'
|
|
4
|
+
import Component from '../../_Component.astro'
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<'table'> & {
|
|
7
|
+
color?: 'base' | 'brand'
|
|
8
|
+
size?: 'sm' | 'md' | 'lg'
|
|
9
|
+
header?:
|
|
10
|
+
| ComponentProps<typeof TableHeader>
|
|
11
|
+
| ComponentProps<typeof TableHeader>['cells']
|
|
12
|
+
body?:
|
|
13
|
+
| ComponentProps<typeof TableBody>
|
|
14
|
+
| ComponentProps<typeof TableBody>['rows']
|
|
15
|
+
footer?:
|
|
16
|
+
| ComponentProps<typeof TableFooter>
|
|
17
|
+
| ComponentProps<typeof TableFooter>['cells']
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const { header, body, footer, ...rest } = Astro.props
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<Component
|
|
24
|
+
class:list={['table']}
|
|
25
|
+
as="table"
|
|
26
|
+
{...rest}
|
|
27
|
+
>
|
|
28
|
+
<TableHeader {...Array.isArray(header) ? { cells: header } : header} />
|
|
29
|
+
|
|
30
|
+
{Array.isArray(body) ? <TableBody rows={body} /> : <TableBody {...body} />}
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
Array.isArray(footer) ? (
|
|
34
|
+
<TableFooter cells={footer} />
|
|
35
|
+
) : (
|
|
36
|
+
<TableFooter {...footer} />
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
<slot />
|
|
41
|
+
</Component>
|
|
42
|
+
|
|
43
|
+
<style is:global lang="scss">
|
|
44
|
+
@import '../../../css/utils.scss';
|
|
45
|
+
|
|
46
|
+
@include component('table') {
|
|
47
|
+
display: table;
|
|
48
|
+
box-shadow: 0 0 0 1px var(--border);
|
|
49
|
+
border-radius: var(--radius-1);
|
|
50
|
+
border-collapse: collapse;
|
|
51
|
+
width: 100%;
|
|
52
|
+
caption-side: bottom;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
3
|
+
import Component from '../../_Component.astro'
|
|
4
|
+
|
|
5
|
+
import TableRow from './TableRow.astro'
|
|
6
|
+
|
|
7
|
+
type Props = HTMLAttributes<'tbody'> & {
|
|
8
|
+
rows?: (
|
|
9
|
+
| ComponentProps<typeof TableRow>
|
|
10
|
+
| ComponentProps<typeof TableRow>['cells']
|
|
11
|
+
)[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { rows, ...rest } = Astro.props
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<Component
|
|
18
|
+
class:list={['table-body']}
|
|
19
|
+
as="tbody"
|
|
20
|
+
{...rest}
|
|
21
|
+
>
|
|
22
|
+
{
|
|
23
|
+
rows?.map((row) => {
|
|
24
|
+
if (Array.isArray(row)) return <TableRow cells={row} />
|
|
25
|
+
else return <TableRow {...row} />
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
<slot />
|
|
29
|
+
</Component>
|
|
30
|
+
|
|
31
|
+
<style is:global lang="scss">
|
|
32
|
+
@import '../../../css/utils.scss';
|
|
33
|
+
|
|
34
|
+
@include component('table-body') {
|
|
35
|
+
display: table-row-group;
|
|
36
|
+
vertical-align: middle;
|
|
37
|
+
unicode-bidi: isolate;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
import Component from '../../_Component.astro'
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<'td'> & {
|
|
6
|
+
html?: string
|
|
7
|
+
text?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { ...rest } = Astro.props
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<Component
|
|
14
|
+
class:list={['table-cell']}
|
|
15
|
+
as="td"
|
|
16
|
+
{...rest}
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</Component>
|
|
20
|
+
|
|
21
|
+
<style is:global lang="scss">
|
|
22
|
+
@import '../../../css/utils.scss';
|
|
23
|
+
|
|
24
|
+
@include component('table-cell') {
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
padding: var(--space-3) var(--space-4);
|
|
27
|
+
color: var(--color-11);
|
|
28
|
+
font-size: var(--text-1);
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
3
|
+
import Component from '../../_Component.astro'
|
|
4
|
+
import TableCell from './TableCell.astro'
|
|
5
|
+
import TableRow from './TableRow.astro'
|
|
6
|
+
|
|
7
|
+
type Props = HTMLAttributes<'tfoot'> & {
|
|
8
|
+
cells?: (
|
|
9
|
+
| ComponentProps<typeof TableCell>
|
|
10
|
+
| ComponentProps<typeof TableCell>['html']
|
|
11
|
+
)[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { cells, ...rest } = Astro.props
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<Component
|
|
18
|
+
class:list={['table-footer']}
|
|
19
|
+
as="tfoot"
|
|
20
|
+
{...rest}
|
|
21
|
+
>
|
|
22
|
+
{
|
|
23
|
+
cells && (
|
|
24
|
+
<TableRow>
|
|
25
|
+
{cells?.map((cell) => {
|
|
26
|
+
if (typeof cell === 'string') return <TableCell html={cell} />
|
|
27
|
+
else return <TableCell {...cell} />
|
|
28
|
+
})}
|
|
29
|
+
</TableRow>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
<slot />
|
|
33
|
+
</Component>
|
|
34
|
+
|
|
35
|
+
<style is:global lang="scss">
|
|
36
|
+
@import '../../../css/utils.scss';
|
|
37
|
+
|
|
38
|
+
@include component('table-footer') {
|
|
39
|
+
display: table-footer-group;
|
|
40
|
+
border-top: 1px solid var(--border);
|
|
41
|
+
background-color: var(--color-3);
|
|
42
|
+
color: var(--color-12);
|
|
43
|
+
|
|
44
|
+
&:last-child {
|
|
45
|
+
border-bottom: none;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
import Component from '../../_Component.astro'
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<'th'> & {
|
|
6
|
+
html?: string
|
|
7
|
+
text?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { ...rest } = Astro.props
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<Component
|
|
14
|
+
class:list={['table-head']}
|
|
15
|
+
as="th"
|
|
16
|
+
{...rest}
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</Component>
|
|
20
|
+
|
|
21
|
+
<style is:global lang="scss">
|
|
22
|
+
@import '../../../css/utils.scss';
|
|
23
|
+
|
|
24
|
+
@include component('table-head') {
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
padding: var(--space-3) var(--space-4);
|
|
27
|
+
color: var(--color-12);
|
|
28
|
+
font-size: var(--text-1);
|
|
29
|
+
text-align: left;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
3
|
+
import Component from '../../_Component.astro'
|
|
4
|
+
import TableHead from './TableHead.astro'
|
|
5
|
+
import TableRow from './TableRow.astro'
|
|
6
|
+
|
|
7
|
+
type Props = HTMLAttributes<'thead'> & {
|
|
8
|
+
cells?: (
|
|
9
|
+
| ComponentProps<typeof TableHead>
|
|
10
|
+
| ComponentProps<typeof TableHead>['html']
|
|
11
|
+
)[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { cells, ...rest } = Astro.props
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<Component
|
|
18
|
+
class:list={['table-header']}
|
|
19
|
+
as="thead"
|
|
20
|
+
{...rest}
|
|
21
|
+
>
|
|
22
|
+
<TableRow>
|
|
23
|
+
{
|
|
24
|
+
cells?.map((cell) => {
|
|
25
|
+
if (typeof cell === 'string') return <TableHead html={cell} />
|
|
26
|
+
else return <TableHead {...cell} />
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
</TableRow>
|
|
30
|
+
<slot />
|
|
31
|
+
</Component>
|
|
32
|
+
|
|
33
|
+
<style is:global lang="scss">
|
|
34
|
+
@import '../../../css/utils.scss';
|
|
35
|
+
|
|
36
|
+
@include component('table-header') {
|
|
37
|
+
border-bottom: 1px solid var(--color-6);
|
|
38
|
+
background-color: var(--color-3);
|
|
39
|
+
|
|
40
|
+
&:last-child {
|
|
41
|
+
border-bottom: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
3
|
+
import Component from '../../_Component.astro'
|
|
4
|
+
import TableCell from './TableCell.astro'
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<'tr'> & {
|
|
7
|
+
cells?: (
|
|
8
|
+
| ComponentProps<typeof TableCell>
|
|
9
|
+
| ComponentProps<typeof TableCell>['text']
|
|
10
|
+
)[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { cells, ...rest } = Astro.props
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<Component
|
|
17
|
+
class:list={['table-row']}
|
|
18
|
+
{...rest}
|
|
19
|
+
as="tr"
|
|
20
|
+
>
|
|
21
|
+
{
|
|
22
|
+
cells?.map((cel) => {
|
|
23
|
+
if (typeof cel === 'string') return <TableCell text={cel} />
|
|
24
|
+
else return <TableCell {...cel} />
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
<slot />
|
|
28
|
+
</Component>
|
|
29
|
+
|
|
30
|
+
<style is:global lang="scss">
|
|
31
|
+
@import '../../../css/utils.scss';
|
|
32
|
+
|
|
33
|
+
@include component('table-row') {
|
|
34
|
+
border-bottom: 1px solid var(--color-6);
|
|
35
|
+
background-color: var(--color-2);
|
|
36
|
+
|
|
37
|
+
&:is(.table-header > &),
|
|
38
|
+
&:is(.table-footer > &) {
|
|
39
|
+
background-color: var(--color-3);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:last-child {
|
|
43
|
+
border-bottom: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps, Polymorphic } from 'astro/types'
|
|
3
|
+
import Component from '../../_Component.astro'
|
|
4
|
+
import Label from '../../typography/Label.astro'
|
|
5
|
+
import Icon from '../Icon.astro'
|
|
6
|
+
import TextareaElement from './TextareaElement.astro'
|
|
7
|
+
|
|
8
|
+
type Props<As extends 'div'> = Polymorphic<{ as: As }> &
|
|
9
|
+
Pick<
|
|
10
|
+
ComponentProps<typeof TextareaElement>,
|
|
11
|
+
| 'variant'
|
|
12
|
+
| 'placeholder'
|
|
13
|
+
| 'name'
|
|
14
|
+
| 'value'
|
|
15
|
+
| 'disabled'
|
|
16
|
+
| 'required'
|
|
17
|
+
| 'rows'
|
|
18
|
+
> & {
|
|
19
|
+
color?: 'base' | 'brand'
|
|
20
|
+
label?: string
|
|
21
|
+
icon?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
as = 'div',
|
|
26
|
+
label,
|
|
27
|
+
icon,
|
|
28
|
+
variant,
|
|
29
|
+
// textarea attributes
|
|
30
|
+
name,
|
|
31
|
+
rows,
|
|
32
|
+
placeholder,
|
|
33
|
+
value,
|
|
34
|
+
disabled,
|
|
35
|
+
required,
|
|
36
|
+
...rest
|
|
37
|
+
} = Astro.props
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
<Component
|
|
41
|
+
class:list={['textarea']}
|
|
42
|
+
{as}
|
|
43
|
+
{...rest}
|
|
44
|
+
>
|
|
45
|
+
<Label
|
|
46
|
+
for={name}
|
|
47
|
+
text={label}
|
|
48
|
+
/>
|
|
49
|
+
<TextareaElement
|
|
50
|
+
id={name}
|
|
51
|
+
{name}
|
|
52
|
+
{variant}
|
|
53
|
+
{placeholder}
|
|
54
|
+
{value}
|
|
55
|
+
{disabled}
|
|
56
|
+
{required}
|
|
57
|
+
{rows}
|
|
58
|
+
/>
|
|
59
|
+
<Icon name={icon} />
|
|
60
|
+
</Component>
|
|
61
|
+
|
|
62
|
+
<style is:global lang="scss">
|
|
63
|
+
@import '../../../css/utils.scss';
|
|
64
|
+
|
|
65
|
+
@include component('textarea') {
|
|
66
|
+
display: flex;
|
|
67
|
+
position: relative;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
gap: var(--space-1);
|
|
70
|
+
width: 100%;
|
|
71
|
+
|
|
72
|
+
.icon {
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: 50%;
|
|
75
|
+
right: var(--space-3);
|
|
76
|
+
transform: translateY(-50%);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
import Component from '../../_Component.astro'
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<'textarea'> & {
|
|
6
|
+
variant?: 'outline'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { variant = 'outline', ...rest } = Astro.props
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Component
|
|
13
|
+
as="textarea"
|
|
14
|
+
class="textarea-element"
|
|
15
|
+
if={true}
|
|
16
|
+
{variant}
|
|
17
|
+
{...rest}
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<style is:global lang="scss">
|
|
21
|
+
@import '../../../css/utils.scss';
|
|
22
|
+
|
|
23
|
+
@include component('textarea-element') {
|
|
24
|
+
display: flex;
|
|
25
|
+
position: relative;
|
|
26
|
+
align-items: center;
|
|
27
|
+
outline: none;
|
|
28
|
+
border: 1px solid var(--border);
|
|
29
|
+
border-radius: var(--radius-1);
|
|
30
|
+
background-color: var(--background);
|
|
31
|
+
padding: var(--space-3);
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: calc((var(--text-1) + 2 * var(--space-4)) * 2);
|
|
34
|
+
min-height: calc((var(--text-1) + 2 * var(--space-4)) * 2);
|
|
35
|
+
resize: vertical;
|
|
36
|
+
color: var(--text);
|
|
37
|
+
font-weight: var(--font-weight);
|
|
38
|
+
font-size: var(--text-1);
|
|
39
|
+
line-height: 1.25;
|
|
40
|
+
font-family: var(--font-family);
|
|
41
|
+
|
|
42
|
+
&::placeholder {
|
|
43
|
+
color: var(--text);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
outline: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:focus {
|
|
51
|
+
outline: none;
|
|
52
|
+
box-shadow: inset 0 0 0 2px var(--border);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:disabled {
|
|
56
|
+
opacity: 50%;
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types'
|
|
3
3
|
import Component from '../_Component.astro'
|
|
4
4
|
|
|
5
|
-
type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> &
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
|
|
6
|
+
structure?: 'column' | 'group' | 'split' | 'spread' | 'row'
|
|
7
|
+
align?: 'start' | 'center' | 'end' | 'stretch'
|
|
8
|
+
frame?: 'panel' | 'none'
|
|
9
|
+
color?: 'base' | 'brand'
|
|
10
|
+
contrast?: boolean
|
|
11
|
+
ratio?: 'landscape' | 'portrait' | 'square' | number
|
|
12
|
+
variant?:
|
|
13
|
+
| 'ghost'
|
|
14
|
+
| 'subtle'
|
|
15
|
+
| 'surface'
|
|
16
|
+
| 'outline'
|
|
17
|
+
| 'soft'
|
|
18
|
+
| 'surface'
|
|
19
|
+
| 'solid'
|
|
20
|
+
}
|
|
20
21
|
|
|
21
22
|
const {
|
|
22
23
|
href,
|
|
23
24
|
as = href ? 'a' : 'div',
|
|
25
|
+
frame = 'panel',
|
|
24
26
|
structure = 'column',
|
|
25
27
|
compact = true,
|
|
26
|
-
|
|
27
|
-
variant = frame === 'panel' ? 'subtle' : undefined,
|
|
28
|
+
variant = 'subtle',
|
|
28
29
|
...rest
|
|
29
30
|
} = Astro.props
|
|
30
31
|
---
|
|
@@ -34,8 +35,8 @@ const {
|
|
|
34
35
|
{compact}
|
|
35
36
|
{href}
|
|
36
37
|
{structure}
|
|
37
|
-
{frame}
|
|
38
38
|
{variant}
|
|
39
|
+
{frame}
|
|
39
40
|
{as}
|
|
40
41
|
{...rest}
|
|
41
42
|
>
|
|
@@ -75,5 +76,27 @@ const {
|
|
|
75
76
|
&.ratio-portrait {
|
|
76
77
|
aspect-ratio: 3/4;
|
|
77
78
|
}
|
|
79
|
+
|
|
80
|
+
&.frame-panel {
|
|
81
|
+
--inner-x: var(--space-7);
|
|
82
|
+
--inner-y: var(--space-7);
|
|
83
|
+
|
|
84
|
+
border: 1px solid var(--border);
|
|
85
|
+
border-radius: var(--radius-3);
|
|
86
|
+
background-color: var(--background);
|
|
87
|
+
padding: var(--inner-y) var(--inner-x);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.align-start {
|
|
91
|
+
align-items: flex-start;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.align-center {
|
|
95
|
+
align-items: center;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&.align-end {
|
|
99
|
+
align-items: flex-end;
|
|
100
|
+
}
|
|
78
101
|
}
|
|
79
102
|
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types'
|
|
3
|
+
import Component from '../_Component.astro'
|
|
4
|
+
|
|
5
|
+
type Props<As extends HTMLTag = 'footer'> = Polymorphic<{ as: As }> & {
|
|
6
|
+
structure?: 'spread' | 'row' | 'split' | 'column'
|
|
7
|
+
variant?: 'base' | 'ghost' | 'subtle' | 'soft' | 'surface' | 'outline'
|
|
8
|
+
frame?: 'fill' | 'panel' | 'contain'
|
|
9
|
+
align?: 'start' | 'center' | 'end'
|
|
10
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
11
|
+
scheme?: 'light' | 'dark'
|
|
12
|
+
color?: 'base' | 'brand'
|
|
13
|
+
compact?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
as = 'footer',
|
|
18
|
+
structure = 'spread',
|
|
19
|
+
variant = 'subtle',
|
|
20
|
+
frame = 'fill',
|
|
21
|
+
...rest
|
|
22
|
+
} = Astro.props
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<Component
|
|
26
|
+
class:list={['footer']}
|
|
27
|
+
{structure}
|
|
28
|
+
{as}
|
|
29
|
+
{variant}
|
|
30
|
+
{frame}
|
|
31
|
+
{...rest}
|
|
32
|
+
>
|
|
33
|
+
<slot />
|
|
34
|
+
</Component>
|
|
35
|
+
|
|
36
|
+
<style is:global lang="scss">
|
|
37
|
+
@import '../../css/utils.scss';
|
|
38
|
+
|
|
39
|
+
@include component('footer') {
|
|
40
|
+
--screen: 1536px;
|
|
41
|
+
--gutter: max(4vw, calc(100vw - var(--screen)) / 2);
|
|
42
|
+
|
|
43
|
+
margin: var(--outer-y) var(--outer-x);
|
|
44
|
+
background: var(--background);
|
|
45
|
+
padding: var(--inner-y) var(--inner-x);
|
|
46
|
+
width: 100%;
|
|
47
|
+
max-width: calc(100% - (2 * var(--outer-x)));
|
|
48
|
+
|
|
49
|
+
&.frame-fill {
|
|
50
|
+
border-top: 1px solid var(--border);
|
|
51
|
+
--inner-x: var(--gutter);
|
|
52
|
+
--outer-x: 0;
|
|
53
|
+
--inner-y: var(--space-7);
|
|
54
|
+
--outer-y: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.frame-panel {
|
|
58
|
+
margin-top: var(--space-2);
|
|
59
|
+
margin-right: var(--gutter);
|
|
60
|
+
margin-left: var(--gutter);
|
|
61
|
+
border: 1px solid var(--border);
|
|
62
|
+
border-radius: var(--radius-3);
|
|
63
|
+
--inner-x: var(--gutter);
|
|
64
|
+
--outer-x: 0;
|
|
65
|
+
--inner-y: var(--space-7);
|
|
66
|
+
--outer-y: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.frame-contain {
|
|
70
|
+
--inner-x: max(4vw, var(--space-7));
|
|
71
|
+
--outer-x: max(0px, calc(var(--gutter) - var(--inner-x)));
|
|
72
|
+
--inner-y: var(--space-7);
|
|
73
|
+
--outer-y: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.align-start {
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.align-center {
|
|
81
|
+
align-items: center;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.align-end {
|
|
85
|
+
align-items: flex-end;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</style>
|