fulldev-ui 0.3.0-beta.3 → 0.3.2
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 +3 -2
- package/src/components/base/Image.astro +116 -42
- package/src/components/base/Logo.astro +1 -1
- package/src/components/base/Rating.astro +27 -25
- 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 +28 -4
- package/src/components/segment/Footer.astro +88 -0
- package/src/components/segment/Header.astro +43 -13
- package/src/components/segment/Section.astro +60 -25
- package/src/components/segment/_regels.md +32 -0
- package/src/components/structure/Bento.astro +38 -0
- package/src/components/{segment → structure}/Box.astro +2 -12
- 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/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 +29 -11
- package/src/integration/tailwind.ts +34 -0
- package/src/integration/unocss.ts +38 -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/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
|
@@ -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>
|
|
@@ -6,7 +6,9 @@ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> &
|
|
|
6
6
|
ComponentProps<typeof Component> & {
|
|
7
7
|
structure?: 'column' | 'group' | 'split' | 'spread' | 'row'
|
|
8
8
|
align?: 'start' | 'center' | 'end' | 'stretch'
|
|
9
|
-
frame?: '
|
|
9
|
+
frame?: 'panel' | 'none'
|
|
10
|
+
color?: 'base' | 'brand'
|
|
11
|
+
contrast?: boolean
|
|
10
12
|
ratio?: 'landscape' | 'portrait' | 'square' | number
|
|
11
13
|
variant?:
|
|
12
14
|
| 'ghost'
|
|
@@ -21,10 +23,10 @@ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> &
|
|
|
21
23
|
const {
|
|
22
24
|
href,
|
|
23
25
|
as = href ? 'a' : 'div',
|
|
26
|
+
frame = 'panel',
|
|
24
27
|
structure = 'column',
|
|
25
28
|
compact = true,
|
|
26
|
-
|
|
27
|
-
variant = frame === 'panel' ? 'subtle' : undefined,
|
|
29
|
+
variant = 'subtle',
|
|
28
30
|
...rest
|
|
29
31
|
} = Astro.props
|
|
30
32
|
---
|
|
@@ -34,8 +36,8 @@ const {
|
|
|
34
36
|
{compact}
|
|
35
37
|
{href}
|
|
36
38
|
{structure}
|
|
37
|
-
{frame}
|
|
38
39
|
{variant}
|
|
40
|
+
{frame}
|
|
39
41
|
{as}
|
|
40
42
|
{...rest}
|
|
41
43
|
>
|
|
@@ -75,5 +77,27 @@ const {
|
|
|
75
77
|
&.ratio-portrait {
|
|
76
78
|
aspect-ratio: 3/4;
|
|
77
79
|
}
|
|
80
|
+
|
|
81
|
+
&.frame-panel {
|
|
82
|
+
--inner-x: var(--space-7);
|
|
83
|
+
--inner-y: var(--space-7);
|
|
84
|
+
|
|
85
|
+
border: 1px solid var(--border);
|
|
86
|
+
border-radius: var(--radius-3);
|
|
87
|
+
background-color: var(--background);
|
|
88
|
+
padding: var(--inner-y) var(--inner-x);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.align-start {
|
|
92
|
+
align-items: flex-start;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.align-center {
|
|
96
|
+
align-items: center;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.align-end {
|
|
100
|
+
align-items: flex-end;
|
|
101
|
+
}
|
|
78
102
|
}
|
|
79
103
|
</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>
|
|
@@ -4,18 +4,18 @@ import Component from '../_Component.astro'
|
|
|
4
4
|
|
|
5
5
|
type Props<As extends HTMLTag = 'header'> = Polymorphic<{ as: As }> &
|
|
6
6
|
ComponentProps<typeof Component> & {
|
|
7
|
-
structure?: 'spread' | '
|
|
7
|
+
structure?: 'spread' | 'row' | 'column'
|
|
8
8
|
position?: 'relative' | 'sticky' | 'fixed' | 'absolute'
|
|
9
|
-
variant?: '
|
|
10
|
-
frame?: '
|
|
9
|
+
variant?: 'ghost' | 'subtle' | 'soft' | 'surface' | 'outline'
|
|
10
|
+
frame?: 'fill' | 'panel'
|
|
11
11
|
align?: 'start' | 'center' | 'end'
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const {
|
|
15
15
|
as = 'header',
|
|
16
16
|
structure = 'spread',
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
frame = 'fill',
|
|
18
|
+
variant = 'subtle',
|
|
19
19
|
compact = true,
|
|
20
20
|
...rest
|
|
21
21
|
} = Astro.props
|
|
@@ -24,9 +24,10 @@ const {
|
|
|
24
24
|
<Component
|
|
25
25
|
class:list={['header']}
|
|
26
26
|
{as}
|
|
27
|
-
{density}
|
|
28
27
|
{frame}
|
|
29
28
|
{compact}
|
|
29
|
+
{structure}
|
|
30
|
+
{variant}
|
|
30
31
|
{...rest}
|
|
31
32
|
>
|
|
32
33
|
<slot />
|
|
@@ -36,7 +37,8 @@ const {
|
|
|
36
37
|
@import '../../css/utils.scss';
|
|
37
38
|
|
|
38
39
|
@include component('header') {
|
|
39
|
-
--
|
|
40
|
+
--screen: 1536px;
|
|
41
|
+
--gutter: max(4vw, calc(100vw - var(--screen)) / 2);
|
|
40
42
|
|
|
41
43
|
display: flex;
|
|
42
44
|
top: 0;
|
|
@@ -45,14 +47,30 @@ const {
|
|
|
45
47
|
justify-content: space-between;
|
|
46
48
|
align-items: center;
|
|
47
49
|
z-index: 10;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
padding-
|
|
50
|
+
border-bottom: 1px solid var(--border);
|
|
51
|
+
background-color: var(--background);
|
|
52
|
+
padding-top: var(--space-4);
|
|
53
|
+
padding-bottom: var(--space-4);
|
|
51
54
|
width: 100%;
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
&.frame-fill {
|
|
57
|
+
padding-top: var(--space-4);
|
|
58
|
+
padding-right: var(--gutter);
|
|
59
|
+
padding-bottom: var(--space-4);
|
|
60
|
+
padding-left: var(--gutter);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.frame-panel {
|
|
64
|
+
margin-top: var(--space-2);
|
|
65
|
+
margin-right: var(--gutter);
|
|
66
|
+
margin-left: var(--gutter);
|
|
67
|
+
border: 1px solid var(--border);
|
|
68
|
+
border-radius: var(--radius-3);
|
|
69
|
+
padding-top: var(--space-2);
|
|
70
|
+
padding-right: var(--space-4);
|
|
71
|
+
padding-bottom: var(--space-2);
|
|
72
|
+
padding-left: var(--space-4);
|
|
73
|
+
}
|
|
56
74
|
|
|
57
75
|
&.position-fixed {
|
|
58
76
|
position: fixed;
|
|
@@ -65,5 +83,17 @@ const {
|
|
|
65
83
|
&.position-sticky {
|
|
66
84
|
position: sticky;
|
|
67
85
|
}
|
|
86
|
+
|
|
87
|
+
&.align-start {
|
|
88
|
+
align-items: flex-start;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.align-center {
|
|
92
|
+
align-items: center;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.align-end {
|
|
96
|
+
align-items: flex-end;
|
|
97
|
+
}
|
|
68
98
|
}
|
|
69
99
|
</style>
|