fulldev-ui 0.1.64 → 0.2.10

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.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/package.json +5 -2
  3. package/src/components/_Children.astro +0 -7
  4. package/src/components/_Tag.astro +35 -14
  5. package/src/components/base/Badge.astro +21 -23
  6. package/src/components/base/Button.astro +22 -36
  7. package/src/components/base/Checkbox.astro +9 -6
  8. package/src/components/base/Icon.astro +23 -14
  9. package/src/components/base/Image.astro +47 -47
  10. package/src/components/base/Input.astro +18 -16
  11. package/src/components/base/Logo.astro +6 -4
  12. package/src/components/base/Radio.astro +8 -6
  13. package/src/components/base/Rating.astro +10 -7
  14. package/src/components/base/Select.astro +17 -13
  15. package/src/components/base/SelectOption.astro +5 -5
  16. package/src/components/base/Switch.astro +11 -12
  17. package/src/components/base/Textarea.astro +9 -7
  18. package/src/components/base/Video.astro +4 -4
  19. package/src/components/base/todo.md +1 -2
  20. package/src/components/{wrapper → segment}/Body.astro +13 -10
  21. package/src/components/segment/Card.astro +94 -0
  22. package/src/components/segment/Deck.astro +36 -0
  23. package/src/components/{wrapper → segment}/Footer.astro +2 -2
  24. package/src/components/segment/Form.astro +30 -0
  25. package/src/components/{wrapper → segment}/Header.astro +16 -34
  26. package/src/components/segment/Main.astro +28 -0
  27. package/src/components/segment/Nav.astro +30 -0
  28. package/src/components/{wrapper → segment}/Prose.astro +15 -15
  29. package/src/components/segment/Section.astro +66 -0
  30. package/src/components/{wrapper → segment}/Writeup.astro +8 -7
  31. package/src/components/segment/todo.md +8 -0
  32. package/src/components/structure/Bento.astro +35 -0
  33. package/src/components/structure/Carousel.astro +43 -0
  34. package/src/components/structure/Grid.astro +30 -0
  35. package/src/components/structure/Group.astro +28 -0
  36. package/src/components/structure/Masonry.astro +39 -0
  37. package/src/components/structure/Split.astro +41 -0
  38. package/src/components/structure/Spread.astro +48 -0
  39. package/src/components/structure/Stack.astro +90 -0
  40. package/src/components/structure/todo.md +5 -0
  41. package/src/components/typography/Heading.astro +37 -19
  42. package/src/components/typography/Label.astro +13 -14
  43. package/src/components/typography/Link.astro +15 -10
  44. package/src/components/typography/List.astro +16 -13
  45. package/src/components/typography/ListItem.astro +16 -11
  46. package/src/components/typography/Paragraph.astro +17 -20
  47. package/src/components/typography/Tagline.astro +17 -22
  48. package/src/components/typography/todo.md +1 -13
  49. package/src/css/colors.css +142 -275
  50. package/src/css/main.css +1 -2
  51. package/src/css/sizes.css +136 -198
  52. package/src/css/styles.css +15 -0
  53. package/src/css/utils.scss +16 -0
  54. package/src/index.ts +22 -15
  55. package/src/integration/integration.ts +39 -57
  56. package/src/layouts/Layout.astro +7 -3
  57. package/src/types/Structuremorphic.ts +18 -0
  58. package/src/components/typography/Links.astro +0 -15
  59. package/src/components/typography/_Typography.astro +0 -28
  60. package/src/components/utility/DecorativeBox.astro +0 -22
  61. package/src/components/wrapper/Card.astro +0 -144
  62. package/src/components/wrapper/Cards.astro +0 -15
  63. package/src/components/wrapper/Deck.astro +0 -133
  64. package/src/components/wrapper/Form.astro +0 -26
  65. package/src/components/wrapper/Group.astro +0 -26
  66. package/src/components/wrapper/Main.astro +0 -25
  67. package/src/components/wrapper/Nav.astro +0 -32
  68. package/src/components/wrapper/Section.astro +0 -110
  69. package/src/components/wrapper/Sections.astro +0 -15
  70. package/src/components/wrapper/_Wrapper.astro +0 -333
  71. package/src/components/wrapper/todo.md +0 -20
  72. package/src/css/border.css +0 -23
  73. package/src/css/font.css +0 -15
  74. package/src/css/reset.css +0 -388
@@ -1,24 +1,27 @@
1
1
  ---
2
- import type { ComponentProps, HTMLTag } from 'astro/types'
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Tag from '../_Tag.astro'
4
4
  import Icon from './Icon.astro'
5
5
 
6
- type Props<As extends HTMLTag = 'div'> = ComponentProps<typeof Tag<As>> & {
7
- value: number | string
8
- }
6
+ type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> &
7
+ ComponentProps<typeof Tag> & {
8
+ value: number | string
9
+ }
9
10
 
10
11
  const { variant = 'accent', value = Astro.props.html, ...rest } = Astro.props
11
12
  ---
12
13
 
13
14
  <Tag
14
- class:list={['full-rating']}
15
+ class:list={['rating']}
15
16
  {...rest}
16
17
  >
17
18
  {value && [1, 2, 3, 4, 5].map(() => <Icon name="star-filled" />)}
18
19
  </Tag>
19
20
 
20
21
  <style is:global lang="scss">
21
- .full-rating {
22
+ @import '../../css/utils.scss';
23
+
24
+ @include component('rating') {
22
25
  display: flex;
23
26
  gap: 0.75rem;
24
27
  padding-left: 5px;
@@ -39,7 +42,7 @@ const { variant = 'accent', value = Astro.props.html, ...rest } = Astro.props
39
42
  width: 1.25em;
40
43
  height: 1em;
41
44
  height: 1.25em;
42
- color: var(--full-accent-foreground);
45
+ color: var(--foreground);
43
46
  }
44
47
  }
45
48
  </style>
@@ -1,4 +1,6 @@
1
1
  ---
2
+ // TODO clean up the styling. Since before every component in Fullui was just one element, we should decide how we are going to handle situation like this where extra elements are needed.
3
+ // I think we should split it up into multiple components, like SelectIcon etc. gr Sil
2
4
  import type { ComponentProps, Polymorphic } from 'astro/types'
3
5
  import { isObject } from 'radash'
4
6
  import Tag from '../_Tag.astro'
@@ -10,18 +12,18 @@ type Props<As extends 'select'> = Polymorphic<{ as: As }> &
10
12
  options?: (ComponentProps<typeof SelectOption> | string)[]
11
13
  }
12
14
 
13
- const { options, ...rest } = Astro.props
15
+ const { as = 'select', options, ...rest } = Astro.props
14
16
  ---
15
17
 
16
18
  <Tag
17
19
  as="div"
18
- class="full-select-wrapper"
20
+ class:list="select-wrapper"
19
21
  {...rest}
20
22
  >
21
23
  <Tag
22
24
  as="select"
23
25
  if={options}
24
- class:list={['full-select full-input']}
26
+ class:list={['select input']}
25
27
  {...rest}
26
28
  >
27
29
  <slot name="before" />
@@ -33,33 +35,35 @@ const { options, ...rest } = Astro.props
33
35
  }
34
36
  <slot />
35
37
  </Tag>
36
- <div class="full-select-icon-wrapper">
38
+ <div class="select-icon-wrapper">
37
39
  <Icon
38
- class="full-select-icon"
40
+ class="select-icon"
39
41
  name="chevron-down"
40
42
  />
41
43
  </div>
42
44
  </Tag>
43
45
 
44
46
  <style is:global lang="scss">
45
- .full-select {
46
- appearance: none;
47
- }
47
+ @import '../../css/utils.scss';
48
48
 
49
- .full-select-wrapper {
50
- position: relative;
51
- width: 100%;
49
+ @include component('select') {
50
+ appearance: none;
52
51
  }
53
52
 
54
- .full-select-icon-wrapper {
53
+ .select-icon-wrapper {
55
54
  display: flex;
56
55
  position: absolute;
57
56
  top: 0;
58
- right: var(--space-element-2);
57
+ right: var(--element-2);
59
58
  align-items: center;
60
59
  margin: 0 !important;
61
60
  padding: 0;
62
61
  height: 100%;
63
62
  pointer-events: none;
64
63
  }
64
+
65
+ .full.select-wrapper {
66
+ position: relative;
67
+ width: 100%;
68
+ }
65
69
  </style>
@@ -9,7 +9,7 @@ const { text, ...rest } = Astro.props
9
9
  ---
10
10
 
11
11
  <option
12
- class:list={['full-option']}
12
+ class:list={['option']}
13
13
  {...rest}
14
14
  >
15
15
  {text}
@@ -17,11 +17,11 @@ const { text, ...rest } = Astro.props
17
17
  </option>
18
18
 
19
19
  <style>
20
- .full-option {
20
+ .full.option {
21
21
  color: var(--foreground);
22
- font-weight: var(--full-font-weight);
23
- font-size: var(--text-element);
22
+ font-weight: var(--font-weight);
23
+ font-size: var(--text-1);
24
24
  line-height: 1;
25
- font-family: var(--full-font-family);
25
+ font-family: var(--font-family);
26
26
  }
27
27
  </style>
@@ -1,21 +1,19 @@
1
1
  ---
2
2
  import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
- import type { Childmorphic } from '../../types/Childmorphic'
4
3
  import Tag from '../_Tag.astro'
5
4
 
6
5
  type Props<As extends HTMLTag = 'span'> = Polymorphic<{ as: As }> &
7
- ComponentProps<typeof Tag> &
8
- Childmorphic<{
6
+ ComponentProps<typeof Tag> & {
9
7
  name?: string
10
- }>
8
+ }
11
9
 
12
10
  const { as = 'input', name, ...rest } = Astro.props
13
11
  ---
14
12
 
15
13
  <Tag
16
- if={true}
17
14
  as="label"
18
- class="full-switch"
15
+ class:list="switch"
16
+ if={true}
19
17
  {...rest}
20
18
  >
21
19
  <input
@@ -27,10 +25,12 @@ const { as = 'input', name, ...rest } = Astro.props
27
25
  </Tag>
28
26
 
29
27
  <style is:global lang="scss">
30
- .full-switch {
28
+ @import '../../css/utils.scss';
29
+
30
+ @include component('switch') {
31
31
  display: block;
32
32
  position: relative;
33
- transition: var(--full-transition);
33
+ transition: var(--transition);
34
34
  cursor: pointer;
35
35
  box-sizing: border-box;
36
36
  border: 1px solid var(--border);
@@ -38,10 +38,9 @@ const { as = 'input', name, ...rest } = Astro.props
38
38
  background-color: var(--background);
39
39
  padding: var(--space-1);
40
40
  min-width: calc(
41
- (var(--text-element) + 2 * var(--space-element-1) * 2) + 2 *
42
- var(--space-1)
41
+ (var(--text-1) + 2 * var(--element-1) * 2) + 2 * var(--space-1)
43
42
  );
44
- height: calc(var(--text-element) + 2 * var(--space-element-1));
43
+ height: calc(var(--text-1) + 2 * var(--element-1));
45
44
 
46
45
  .checkbox {
47
46
  position: absolute;
@@ -52,7 +51,7 @@ const { as = 'input', name, ...rest } = Astro.props
52
51
 
53
52
  .checkmark {
54
53
  transform: 0%;
55
- transition: var(--full-transition);
54
+ transition: var(--transition);
56
55
  border-radius: 999px;
57
56
  background-color: var(--border);
58
57
  width: 50%;
@@ -1,8 +1,9 @@
1
1
  ---
2
- import type { ComponentProps, HTMLTag } from 'astro/types'
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Tag from '../_Tag.astro'
4
4
 
5
- type Props<As extends HTMLTag = 'textarea'> = ComponentProps<typeof Tag>
5
+ type Props<As extends HTMLTag = 'textarea'> = Polymorphic<{ as: As }> &
6
+ ComponentProps<typeof Tag>
6
7
 
7
8
  const {
8
9
  as = 'textarea',
@@ -14,18 +15,19 @@ const {
14
15
  ---
15
16
 
16
17
  <Tag
17
- class:list={['full-textarea']}
18
- if={name}
18
+ class:list={['textarea input']}
19
+ if={true}
19
20
  {rows}
20
- {name}
21
21
  {variant}
22
22
  {as}
23
23
  {...rest}
24
24
  />
25
25
 
26
26
  <style is:global lang="scss">
27
- .full-textarea {
28
- height: calc((var(--text-element) + 2 * var(--space-element-3)) * 2);
27
+ @import '../../css/utils.scss';
28
+
29
+ @include component('textarea') {
30
+ height: calc((var(--text-1) + 2 * var(--element-3)) * 2);
29
31
  resize: vertical;
30
32
  }
31
33
  </style>
@@ -1,4 +1,5 @@
1
- ---
1
+ <!-- ---
2
+ //
2
3
  type Props = any & {
3
4
  src: string
4
5
  thumbnail?: string
@@ -13,7 +14,7 @@ const youtubeId =
13
14
  {
14
15
  youtubeId && !thumbnail && (
15
16
  <iframe
16
- class:list={['full-image full-video']}
17
+ class:list={['image video']}
17
18
  src={`https://www.youtube.com/embed/${youtubeId}?controls=0&showinfo=0&rel=0&modestbranding=1&loop=1`}
18
19
  title="YouTube video player"
19
20
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
@@ -21,7 +22,6 @@ const youtubeId =
21
22
  />
22
23
  )
23
24
  }
24
-
25
25
  {
26
26
  youtubeId && thumbnail && (
27
27
  <img
@@ -29,4 +29,4 @@ const youtubeId =
29
29
  alt=""
30
30
  />
31
31
  )
32
- }
32
+ } -->
@@ -4,5 +4,4 @@
4
4
  - Stat (for displaying a number with a label)
5
5
  - Spinner (for loading states)
6
6
  - Bubble (for whatsapp chat bubbles etc)
7
-
8
- ## Low priority
7
+ - Divider (for separating with a light border)
@@ -1,32 +1,35 @@
1
1
  ---
2
2
  import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
- import Wrapper from './_Wrapper.astro'
3
+ import Tag from '../_Tag.astro'
4
4
 
5
5
  type Props<As extends HTMLTag = 'body'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Wrapper>
6
+ ComponentProps<typeof Tag>
7
7
 
8
- const { as = 'body', x = 'fill', ...rest } = Astro.props
8
+ const { as = 'body', ...rest } = Astro.props
9
9
  ---
10
10
 
11
- <Wrapper
12
- class:list={['full-body']}
11
+ <Tag
12
+ class:list={['body']}
13
13
  {as}
14
- {x}
15
14
  {...rest}
16
15
  >
17
- <slot name="before" />
18
16
  <slot />
19
17
 
20
18
  <style is:global lang="scss">
21
- .full-body {
19
+ @import '../../css/utils.scss';
20
+
21
+ @include component('body') {
22
+ display: flex;
23
+ flex-direction: column;
24
+ align-items: stretch;
22
25
  margin: 0;
23
26
  background: var(--background);
24
27
  padding: 0;
25
28
  height: 100%;
26
29
  min-height: 100vh;
27
30
  color: var(--foreground);
28
- font-size: var(--text);
31
+ font-size: var(--text-2);
29
32
  font-family: var(--font-family);
30
33
  }
31
34
  </style>
32
- </Wrapper>
35
+ </Tag>
@@ -0,0 +1,94 @@
1
+ ---
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
+ import Tag from '../_Tag.astro'
4
+
5
+ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> &
6
+ ComponentProps<typeof Tag> & {
7
+ structure?: 'stack' | 'group' | 'split' | 'spread'
8
+ align?: 'start' | 'center' | 'end' | 'stretch'
9
+ variant?: 'base' | 'raised' | 'primary'
10
+ frame?: 'fill' | 'panel'
11
+ ratio?: 'landscape' | 'portrait' | 'square' | number
12
+ }
13
+
14
+ const {
15
+ as = Astro.props.href ? 'a' : 'div',
16
+ structure = 'stack',
17
+ density = 'compact',
18
+ frame = 'panel',
19
+ variant = 'raised',
20
+ ...rest
21
+ } = Astro.props
22
+ ---
23
+
24
+ <Tag
25
+ class:list={['card']}
26
+ {structure}
27
+ {density}
28
+ {frame}
29
+ {variant}
30
+ {as}
31
+ {...rest}
32
+ >
33
+ <slot />
34
+ </Tag>
35
+
36
+ <style is:global lang="scss">
37
+ @import '../../css/utils.scss';
38
+
39
+ @include component('card') {
40
+ position: relative;
41
+ overflow: hidden;
42
+ text-decoration: none;
43
+
44
+ &[href] {
45
+ cursor: pointer;
46
+
47
+ > .full.image {
48
+ transition: var(--transition);
49
+ }
50
+
51
+ &:hover {
52
+ > .full.image {
53
+ opacity: 0.85;
54
+ }
55
+ }
56
+ }
57
+
58
+ &.frame-panel {
59
+ gap: 0;
60
+ border: 1px solid var(--border);
61
+ border-radius: var(--radius-2);
62
+ background-color: var(--background);
63
+ padding: var(--space-5);
64
+ overflow: hidden;
65
+ color: var(--foreground);
66
+ }
67
+
68
+ &.ratio-landscape {
69
+ aspect-ratio: 4/3;
70
+ }
71
+
72
+ &.ratio-square {
73
+ aspect-ratio: 1/1;
74
+ }
75
+
76
+ &.ratio-portrait {
77
+ aspect-ratio: 3/4;
78
+ }
79
+
80
+ & > .frame-inset {
81
+ margin-right: calc(var(--space-5) * -1);
82
+ margin-left: calc(var(--space-5) * -1);
83
+ width: calc(100% + var(--space-5) * 2);
84
+
85
+ &:first-child {
86
+ margin-top: calc(var(--space-5) * -1);
87
+ }
88
+
89
+ &:last-child {
90
+ margin-bottom: calc(var(--space-5) * -1);
91
+ }
92
+ }
93
+ }
94
+ </style>
@@ -0,0 +1,36 @@
1
+ ---
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
+ import Tag from '../_Tag.astro'
4
+
5
+ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> &
6
+ ComponentProps<typeof Tag> & {
7
+ structure?: 'grid' | 'carousel' | 'masonry' | 'bento'
8
+ frame?: 'none' | 'fill' | 'inset'
9
+ }
10
+
11
+ const { structure = 'grid', ...rest } = Astro.props
12
+ ---
13
+
14
+ <Tag
15
+ class:list={['deck']}
16
+ {structure}
17
+ {...rest}
18
+ >
19
+ <slot />
20
+ </Tag>
21
+
22
+ <style is:global lang="scss">
23
+ @import '../../css/utils.scss';
24
+
25
+ @include component('deck') {
26
+ position: relative;
27
+ width: 100%;
28
+
29
+ &.frame-fill {
30
+ margin-right: calc(var(--space-gutter) * -1);
31
+ margin-left: calc(var(--space-gutter) * -1);
32
+ padding: 0 var(--space-gutter) var(--space-3);
33
+ width: calc(100% + var(--space-gutter) * 2);
34
+ }
35
+ }
36
+ </style>
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
- import Wrapper from './_Wrapper.astro'
3
+ import type Tag from '../_Tag.astro'
4
4
 
5
5
  type Props<As extends HTMLTag = 'footer'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Wrapper>
6
+ ComponentProps<typeof Tag>
7
7
 
8
8
  const {
9
9
  as = 'footer',
@@ -0,0 +1,30 @@
1
+ ---
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
+ import Tag from '../_Tag.astro'
4
+
5
+ type Props<As extends HTMLTag = 'form'> = Polymorphic<{ as: As }> &
6
+ ComponentProps<typeof Tag> & {
7
+ structure?: 'stack' | 'group'
8
+ }
9
+
10
+ const { as = 'form', structure = 'stack', ...rest } = Astro.props
11
+ ---
12
+
13
+ <Tag
14
+ class:list={['form']}
15
+ {as}
16
+ {structure}
17
+ {...rest}
18
+ >
19
+ <slot />
20
+ </Tag>
21
+
22
+ <style is:global lang="scss">
23
+ @import '../../css/utils.scss';
24
+
25
+ @include component('form') {
26
+ display: flex;
27
+ width: 100%;
28
+ max-width: calc(var(--element-3) * 36);
29
+ }
30
+ </style>
@@ -1,46 +1,37 @@
1
1
  ---
2
2
  import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
- import Wrapper from './_Wrapper.astro'
3
+ import Tag from '../_Tag.astro'
4
4
 
5
5
  type Props<As extends HTMLTag = 'header'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Wrapper> & {
7
- frame?: 'screen' | 'panel'
6
+ ComponentProps<typeof Tag> & {
7
+ structure?: 'spread' | 'group' | 'stack'
8
8
  position?: 'relative' | 'sticky' | 'fixed' | 'absolute'
9
+ variant?: 'base' | 'raised'
10
+ frame?: 'fill' | 'panel'
11
+ align?: 'start' | 'center' | 'end'
9
12
  }
10
13
 
11
14
  const {
12
15
  as = 'header',
13
- direction = 'horizontal',
14
- y = 'center',
16
+ structure = 'spread',
15
17
  density = 'compact',
16
- variant,
17
- position,
18
- frame,
19
18
  ...rest
20
19
  } = Astro.props
21
20
  ---
22
21
 
23
- <Wrapper
24
- class:list={[
25
- 'full-header',
26
- {
27
- [`full-frame-${frame}`]: frame,
28
- [`full-position-${position}`]: position,
29
- },
30
- ]}
22
+ <Tag
23
+ class:list={['header']}
31
24
  {as}
32
- {direction}
33
- {y}
34
25
  {density}
35
- {variant}
36
26
  {...rest}
37
27
  >
38
- <slot name="before" />
39
28
  <slot />
40
- </Wrapper>
29
+ </Tag>
41
30
 
42
31
  <style is:global lang="scss">
43
- .full-header {
32
+ @import '../../css/utils.scss';
33
+
34
+ @include component('header') {
44
35
  display: flex;
45
36
  top: 0;
46
37
  right: 0;
@@ -52,25 +43,16 @@ const {
52
43
  padding: var(--space-3) var(--space-gutter);
53
44
  width: 100%;
54
45
 
55
- &.full-position-fixed {
46
+ &.position-fixed {
56
47
  position: fixed;
57
48
  }
58
49
 
59
- &.full-position-absolute {
50
+ &.position-absolute {
60
51
  position: absolute;
61
52
  }
62
53
 
63
- &.full-position-sticky {
54
+ &.position-sticky {
64
55
  position: sticky;
65
56
  }
66
-
67
- &.subtle {
68
- border-color: var(--6);
69
- background-color: var(--2);
70
- }
71
-
72
- &.bordered {
73
- border-bottom: 1px solid var(--border);
74
- }
75
57
  }
76
58
  </style>
@@ -0,0 +1,28 @@
1
+ ---
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
+ import Tag from '../_Tag.astro'
4
+
5
+ type Props<As extends HTMLTag = 'main'> = Polymorphic<{ as: As }> &
6
+ ComponentProps<typeof Tag>
7
+
8
+ const { as = 'main', ...rest } = Astro.props
9
+ ---
10
+
11
+ <Tag
12
+ class:list={['main']}
13
+ {as}
14
+ {...rest}
15
+ >
16
+ <slot />
17
+ </Tag>
18
+
19
+ <style is:global lang="scss">
20
+ @import '../../css/utils.scss';
21
+
22
+ @include component('main') {
23
+ display: flex;
24
+ flex-direction: column;
25
+ align-items: stretch;
26
+ width: 100%;
27
+ }
28
+ </style>
@@ -0,0 +1,30 @@
1
+ ---
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
+ import Tag from '../_Tag.astro'
4
+
5
+ type Props<As extends HTMLTag = 'nav'> = Polymorphic<{ as: As }> &
6
+ ComponentProps<typeof Tag> & {
7
+ structure?: 'spread' | 'group'
8
+ align?: 'start' | 'center' | 'end'
9
+ }
10
+
11
+ const { as = 'nav', structure = 'spread', ...rest } = Astro.props
12
+ ---
13
+
14
+ <Tag
15
+ class:list={['nav']}
16
+ {as}
17
+ {structure}
18
+ {...rest}
19
+ >
20
+ <slot />
21
+ </Tag>
22
+
23
+ <style is:global lang="scss">
24
+ @import '../../css/utils.scss';
25
+
26
+ @include component('nav') {
27
+ margin-left: auto;
28
+ width: max-content;
29
+ }
30
+ </style>