fulldev-ui 0.3.6 → 0.3.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fulldev-ui",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "A component library built for Astro",
5
5
  "homepage": "https://ui.full.dev",
6
6
  "bugs": "https://github.com/fulldotdev/ui/issues",
@@ -28,6 +28,7 @@ const {
28
28
  structure,
29
29
  text,
30
30
  html,
31
+ radius,
31
32
  level,
32
33
  ...rest
33
34
  } = Astro.props
@@ -62,6 +63,7 @@ const render =
62
63
  [`ratio-${ratio}`]: ratio,
63
64
  [`color-${color}`]: color,
64
65
  [`underline-${underline}`]: underline,
66
+ [`radius-${radius}`]: radius,
65
67
  },
66
68
  ]}
67
69
  {...rest}
@@ -1,5 +1,5 @@
1
- ---
2
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
1
+ <!-- ---
2
+ import type { ComponentProps,HTMLTag,Polymorphic } from 'astro/types'
3
3
  import Component from '../_Component.astro'
4
4
 
5
5
  type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> &
@@ -21,4 +21,4 @@ const { as = 'div', ...rest } = Astro.props
21
21
 
22
22
  @include component('writeup') {
23
23
  }
24
- </style>
24
+ </style> -->
@@ -0,0 +1,23 @@
1
+ ---
2
+ import type { ComponentProps } from 'astro/types'
3
+ import { Image } from 'fulldev-ui'
4
+
5
+ type Props = Omit<ComponentProps<typeof Image>, 'position' | 'frame'> & {}
6
+
7
+ const { ...rest } = Astro.props
8
+ ---
9
+
10
+ <Image
11
+ class="avatar"
12
+ {...rest}
13
+ />
14
+
15
+ <style is:global lang="scss">
16
+ @import '../../css/utils.scss';
17
+
18
+ @include component('avatar') {
19
+ border-radius: var(--radius-3);
20
+ max-width: calc(2.8 * var(--space-6));
21
+ height: auto;
22
+ }
23
+ </style>
@@ -6,6 +6,7 @@ import Icon from './Icon.astro'
6
6
  type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
7
7
  size?: 'sm' | 'md' | 'lg'
8
8
  color?: 'base' | 'brand'
9
+ radius?: 'small' | 'medium' | 'large' | 'full'
9
10
  contrast?: boolean
10
11
  html?: string
11
12
  text?: string
@@ -77,5 +78,21 @@ const { as = 'a', variant = 'solid', contrast, icon, ...rest } = Astro.props
77
78
  color: var(--colo-12);
78
79
  }
79
80
  }
81
+
82
+ &.radius-small {
83
+ border-radius: var(--radius-1);
84
+ }
85
+
86
+ &.radius-medium {
87
+ border-radius: var(--radius-2);
88
+ }
89
+
90
+ &.radius-large {
91
+ border-radius: var(--radius-3);
92
+ }
93
+
94
+ &.radius-full {
95
+ border-radius: 9999px;
96
+ }
80
97
  }
81
98
  </style>
@@ -9,6 +9,7 @@ type Props = HTMLAttributes<'img'> & {
9
9
  frame?: 'inset'
10
10
  width?: number | 1920
11
11
  height?: number | 1920
12
+ radius?: 'small' | 'medium' | 'large' | 'full'
12
13
  }
13
14
 
14
15
  function getAltBySrc(): string {
@@ -27,6 +28,7 @@ const {
27
28
  frame,
28
29
  width,
29
30
  height,
31
+ radius,
30
32
  ...rest
31
33
  } = Astro.props
32
34
  ---
@@ -43,6 +45,7 @@ const {
43
45
  as="img"
44
46
  {frame}
45
47
  {position}
48
+ {radius}
46
49
  {...rest}
47
50
  />
48
51
  )}
@@ -79,6 +82,22 @@ const {
79
82
  mask-image: linear-gradient(to top, transparent 0%, black 100%);
80
83
  }
81
84
 
85
+ &.radius-small {
86
+ border-radius: var(--radius-1);
87
+ }
88
+
89
+ &.radius-medium {
90
+ border-radius: var(--radius-2);
91
+ }
92
+
93
+ &.radius-large {
94
+ border-radius: var(--radius-3);
95
+ }
96
+
97
+ &.radius-full {
98
+ border-radius: 9999px;
99
+ }
100
+
82
101
  &.position-background {
83
102
  position: absolute;
84
103
  top: 0;
@@ -1,34 +1,23 @@
1
1
  ---
2
- import type { ComponentProps, HTMLTag } from 'astro/types'
3
- import Children from '../_Children.astro'
4
- import Component from '../_Component.astro'
2
+ import type { ComponentProps } from 'astro/types'
3
+ import { Image } from 'fulldev-ui'
5
4
 
6
- type Props<As extends HTMLTag = 'a'> = ComponentProps<typeof Children>
5
+ type Props = Omit<ComponentProps<typeof Image>, 'position' | 'frame'> & {}
7
6
 
8
- const { as = 'a', href = '/', src, ...rest } = Astro.props
7
+ const { ...rest } = Astro.props
9
8
  ---
10
9
 
11
- <Component
12
- class:list={['logo']}
13
- {href}
14
- {as}
10
+ <Image
11
+ class="logo"
15
12
  {...rest}
16
- >
17
- <slot name="before" />
18
- <Children {...rest} />
19
- <slot />
20
- </Component>
13
+ />
21
14
 
22
15
  <style is:global lang="scss">
23
16
  @import '../../css/utils.scss';
24
17
 
25
18
  @include component('logo') {
26
- .image {
27
- display: block !important;
28
- width: auto !important;
29
- height: var(--space-6) !important;
30
- object-fit: contain !important;
31
- color: var(--12) !important;
32
- }
19
+ max-width: calc(15 * var(--space-2));
20
+ height: 100%;
21
+ object-fit: contain;
33
22
  }
34
23
  </style>
@@ -28,8 +28,6 @@ const getIcon = (count: number) => {
28
28
  [1, 2, 3, 4, 5].map((_, i) => (
29
29
  <>
30
30
  <Icon
31
- size={size}
32
- compact={compact}
33
31
  name={getIcon(i + 1)}
34
32
  class:list={'rating-icon-solid'}
35
33
  />
@@ -42,7 +42,7 @@ const {
42
42
  >
43
43
  <Label
44
44
  for={name}
45
- {...typeof label === 'string' ? { text: label } : label}
45
+ text={label}
46
46
  />
47
47
  <SelectElement
48
48
  id={name}
@@ -8,6 +8,7 @@ type Props<As extends HTMLTag = 'header'> = Polymorphic<{ as: As }> & {
8
8
  variant?: 'ghost' | 'subtle' | 'soft' | 'surface' | 'outline'
9
9
  frame?: 'fill' | 'panel'
10
10
  align?: 'start' | 'center' | 'end'
11
+ compact?: boolean
11
12
  }
12
13
 
13
14
  const {
@@ -43,8 +44,6 @@ const {
43
44
  top: 0;
44
45
  right: 0;
45
46
  left: 0;
46
- justify-content: space-between;
47
- align-items: center;
48
47
  z-index: 10;
49
48
  border-bottom: 1px solid var(--border);
50
49
  background-color: var(--background);
@@ -82,17 +81,5 @@ const {
82
81
  &.position-sticky {
83
82
  position: sticky;
84
83
  }
85
-
86
- &.align-start {
87
- align-items: flex-start;
88
- }
89
-
90
- &.align-center {
91
- align-items: center;
92
- }
93
-
94
- &.align-end {
95
- align-items: flex-end;
96
- }
97
84
  }
98
85
  </style>