fulldev-ui 0.3.15 → 0.3.17

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.15",
3
+ "version": "0.3.17",
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",
@@ -30,6 +30,7 @@ const {
30
30
  html,
31
31
  radius,
32
32
  level,
33
+ mask,
33
34
  ...rest
34
35
  } = Astro.props
35
36
 
@@ -64,6 +65,7 @@ const render =
64
65
  [`color-${color}`]: color,
65
66
  [`underline-${underline}`]: underline,
66
67
  [`radius-${radius}`]: radius,
68
+ [`mask-${mask}`]: mask,
67
69
  },
68
70
  ]}
69
71
  {...rest}
@@ -83,6 +85,7 @@ const render =
83
85
  @import '../css/space.scss';
84
86
 
85
87
  @include component('full') {
88
+ z-index: 1;
86
89
  box-sizing: border-box;
87
90
  }
88
91
  </style>
@@ -11,7 +11,7 @@ const { radius = 'auto', variant = 'ghost', ...rest } = Astro.props
11
11
  ---
12
12
 
13
13
  <Image
14
- class="avatar"
14
+ class:list={'avatar'}
15
15
  {variant}
16
16
  {radius}
17
17
  {...rest}
@@ -24,8 +24,10 @@ const { radius = 'auto', variant = 'ghost', ...rest } = Astro.props
24
24
  display: block;
25
25
  border: 1px solid var(--border);
26
26
  border-radius: var(--radius-3);
27
- width: calc(var(--text-1) + 2 * var(--space-4));
28
- height: calc(var(--text-1) + 2 * var(--space-4));
27
+ // width: calc(var(--text-1) + 2 * var(--space-4)) !important;
28
+ // height: calc(var(--text-1) + 2 * var(--space-4)) !important;
29
+ width: calc(4.4 * var(--space-3)) !important;
30
+ height: calc(4.4 * var(--space-3)) !important;
29
31
  object-fit: cover;
30
32
 
31
33
  &.radius-none {
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Component from '../_Component.astro'
4
+ import Label from '../typography/Label.astro'
5
+ import Text from '../typography/Text.astro'
6
+ import Avatar from './Avatar.astro'
4
7
  import Icon from './Icon.astro'
5
8
 
6
9
  type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
@@ -12,6 +15,8 @@ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
12
15
  html?: string
13
16
  text?: string
14
17
  icon?: string
18
+ label?: string
19
+ avatar?: string
15
20
  }
16
21
 
17
22
  const {
@@ -20,6 +25,10 @@ const {
20
25
  radius = 'auto',
21
26
  contrast,
22
27
  icon,
28
+ label,
29
+ avatar,
30
+ text,
31
+ html,
23
32
  ...rest
24
33
  } = Astro.props
25
34
  ---
@@ -32,8 +41,19 @@ const {
32
41
  {radius}
33
42
  {...rest}
34
43
  >
44
+ <Label
45
+ as="span"
46
+ style={{ color: 'inherit' }}
47
+ html={label || text || html}
48
+ />
49
+
50
+ <!-- <Text
51
+ as="span"
52
+ html={text}
53
+ /> -->
35
54
  <slot />
36
55
  <Icon name={icon} />
56
+ <Avatar src={avatar} />
37
57
  </Component>
38
58
 
39
59
  <style is:global lang="scss">
@@ -45,14 +65,11 @@ const {
45
65
  justify-content: center;
46
66
  align-items: center;
47
67
  vertical-align: top;
48
- gap: var(--space-2);
49
68
  transition: background-color var(--transition);
50
69
  cursor: pointer;
51
70
  outline: none !important;
52
71
  border: 1px solid var(--border);
53
72
  background-color: var(--background);
54
- padding-right: var(--space-4);
55
- padding-left: var(--space-4);
56
73
  height: calc(var(--text-1) + 2 * var(--space-4));
57
74
  color: var(--text);
58
75
  font-weight: var(--button-font-weight);
@@ -63,6 +80,19 @@ const {
63
80
  text-decoration: none;
64
81
  white-space: nowrap;
65
82
 
83
+ span {
84
+ padding-right: var(--space-4);
85
+ padding-left: var(--space-4);
86
+ }
87
+
88
+ .avatar {
89
+ margin-left: -2px;
90
+ margin-left: calc(-1 * (var(--space-1) / 3));
91
+ padding: calc(var(--space-1) / 3);
92
+ width: calc(var(--text-1) + 2 * var(--space-4)) !important;
93
+ height: calc(var(--text-1) + 2 * var(--space-4)) !important;
94
+ }
95
+
66
96
  &:focus-visible {
67
97
  outline: 2px solid var(--focus) !important;
68
98
  outline-offset: 2px;
@@ -79,12 +79,15 @@ const {
79
79
  }
80
80
 
81
81
  &.mask-md {
82
+ -webkit-mask-image: linear-gradient(to top, transparent 0%, black 65%);
83
+ mask-image: linear-gradient(to top, transparent 0%, black 65%);
84
+ }
85
+
86
+ &.mask-lg {
82
87
  -webkit-mask-image: linear-gradient(to top, transparent 0%, black 100%);
83
88
  mask-image: linear-gradient(to top, transparent 0%, black 100%);
84
89
  }
85
90
 
86
-
87
-
88
91
  &.radius-none {
89
92
  border-radius: 0;
90
93
  }
@@ -1,18 +1,37 @@
1
1
  ---
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Component from '../_Component.astro'
4
+ import Column from '../structure/Column.astro'
5
+ import Row from '../structure/Row.astro'
6
+ import Heading from '../typography/Heading.astro'
7
+ import Label from '../typography/Label.astro'
8
+ import Avatar from './Avatar.astro'
4
9
  import Icon from './Icon.astro'
5
10
 
6
11
  type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
7
12
  color?: 'base' | 'brand'
13
+ radius?: 'none' | 'auto' | 'full'
8
14
  value?: number
9
15
  size?: string
10
16
  compact?: boolean
17
+ avatars?: string[]
18
+ label?: string
19
+ heading: string
11
20
  }
12
21
 
13
- const { size, compact, value = 5, ...rest } = Astro.props
22
+ const {
23
+ color = 'brand',
24
+ radius = 'full',
25
+ compact = true,
26
+ value,
27
+ heading,
28
+ avatars,
29
+ label,
30
+ ...rest
31
+ } = Astro.props
14
32
 
15
33
  const getIcon = (count: number) => {
34
+ if (!value) return
16
35
  const difference = value - count
17
36
  if (difference >= -0.25) return 'star-filled'
18
37
  if (difference >= -0.75) return 'star-half-filled'
@@ -22,18 +41,39 @@ const getIcon = (count: number) => {
22
41
 
23
42
  <Component
24
43
  class:list={['rating']}
44
+ {compact}
25
45
  {...rest}
26
46
  >
27
47
  {
28
- [1, 2, 3, 4, 5].map((_, i) => (
29
- <>
30
- <Icon
31
- name={getIcon(i + 1)}
32
- class:list={'rating-icon-solid'}
33
- />
34
- </>
48
+ avatars?.map((avatar) => (
49
+ <Avatar
50
+ {radius}
51
+ src={avatar}
52
+ />
35
53
  ))
36
54
  }
55
+ <Column>
56
+ <Row>
57
+ {
58
+ value &&
59
+ [1, 2, 3, 4, 5].map((_, i) => (
60
+ <Icon
61
+ {color}
62
+ name={getIcon(i + 1)}
63
+ class:list={'rating-icon-solid'}
64
+ />
65
+ ))
66
+ }
67
+ </Row>
68
+ <Label
69
+ color="base"
70
+ html={label}
71
+ />
72
+ <Heading
73
+ level={6}
74
+ html={heading}
75
+ />
76
+ </Column>
37
77
  </Component>
38
78
 
39
79
  <style is:global lang="scss">
@@ -41,7 +81,23 @@ const getIcon = (count: number) => {
41
81
 
42
82
  @include component('rating') {
43
83
  display: inline-flex;
44
- position: relative;
45
- gap: var(--space-2);
84
+ align-items: center;
85
+
86
+ .avatar {
87
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
88
+ }
89
+
90
+ * + .column {
91
+ margin-left: var(--space-4);
92
+ }
93
+
94
+ .label,
95
+ .heading {
96
+ margin-top: var(--space-2) !important;
97
+ }
98
+
99
+ .avatar + .avatar {
100
+ margin-left: calc(-1 * var(--space-5));
101
+ }
46
102
  }
47
103
  </style>
@@ -52,7 +52,6 @@ const {
52
52
 
53
53
  @include component('card') {
54
54
  position: relative;
55
- overflow: hidden;
56
55
  text-decoration: none;
57
56
 
58
57
  &[href] {
@@ -92,6 +91,7 @@ const {
92
91
  border: 1px solid var(--border);
93
92
  background-color: var(--background);
94
93
  padding: var(--inner-y) var(--inner-x);
94
+ overflow: hidden;
95
95
 
96
96
  &.radius-none {
97
97
  border-radius: 0;
@@ -80,6 +80,7 @@ const {
80
80
 
81
81
  border: 1px solid var(--border);
82
82
  border-radius: var(--radius-3);
83
+ overflow: hidden;
83
84
  }
84
85
  }
85
86
  </style>
@@ -32,12 +32,12 @@
32
32
  }
33
33
 
34
34
  .full + .label,
35
+ .icon + .icon,
35
36
  .label + .full {
36
37
  margin-left: var(--space-2);
37
38
  }
38
39
 
39
- .image + .full,
40
- .icon + .full {
40
+ .image + .full {
41
41
  margin-left: var(--space-6);
42
42
  }
43
43
  }
@@ -61,7 +61,6 @@
61
61
  }
62
62
 
63
63
  .full + .heading,
64
- .full + .label,
65
64
  .full + .link,
66
65
  .full + .list,
67
66
  .full + .paragraph,
@@ -85,6 +84,7 @@
85
84
  .label + .input,
86
85
  .variant-link + .variant-link,
87
86
  .label + .textarea,
87
+ .full + .label,
88
88
  .label + .select {
89
89
  margin-top: var(--space-2);
90
90
  }