@uqds/card 0.1.0-alpha.2 → 0.1.0-alpha.4

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/dist/css/main.css CHANGED
@@ -1 +1 @@
1
- :root{--card-title-font-size: 24px}@media(max-width: 37.4375rem){:root{--card-title-font-size: 22px}}.uq-card,.uq-story-card{position:relative;display:flex;flex-direction:column;border-radius:4px;border:1px solid #dcdcdd;background:#fff}.uq-card:has(a:focus-visible),.uq-story-card:has(a:focus-visible){outline:4px solid #0d6dcd;outline-offset:-1px}.uq-card:hover,.uq-story-card:hover{background:#f3f3f4}.uq-card:hover .uq-card__content::after,.uq-story-card:hover .uq-card__content::after{left:8px}.uq-card__content{flex:1;display:flex;flex-direction:column;padding:1.5rem}.uq-card__content::after{content:"";height:24px;width:24px;margin-top:auto;padding-top:1.5rem;position:relative;box-sizing:content-box;background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4 12h15M14 18l6-6-6-6' stroke='%2351247a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e");background-position:right bottom;background-size:24px;background-repeat:no-repeat;transition:left 200ms ease-in-out;left:0}.uq-story-card__title,.uq-card__title{margin:0;color:#19151c;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden;font-size:var(--card-title-font-size)}.uq-story-card__title a,.uq-card__title a{color:#19151c}.uq-story-card__title a::after,.uq-card__title a::after{content:"";position:absolute;inset:0}.uq-story-card__title a:focus,.uq-card__title a:focus{outline:none}.uq-story-card__title a:hover,.uq-card__title a:hover{background-color:rgba(0,0,0,0)}.uq-card__description,.uq-story-card__description{margin-top:.5rem}.uq-card__image,.uq-story-card__image{aspect-ratio:1.5/1;position:relative;flex-shrink:0}.uq-card__image img,.uq-story-card__image img,.uq-card__image picture,.uq-story-card__image picture{width:100%;height:100%;inset:0;position:absolute;object-fit:cover}.uq-card__icon{margin-bottom:.5rem}.uq-card__icon .uq-icon::before{height:56px;width:56px}.uq-card--text .uq-card__image,.uq-card--text .uq-story-card__image,.uq-card--text .uq-card__icon{display:none}.uq-card--image .uq-card__icon{display:none}.uq-card--icon .uq-card__image,.uq-card--icon .uq-story-card__image,.uq-card--icon-nav .uq-card__image,.uq-card--icon-nav .uq-story-card__image{display:none}@media(max-width: 37.4375rem){.uq-card--icon-nav .uq-card__content{display:flex;align-items:center;flex-direction:row}.uq-card--icon-nav .uq-card__content::after{padding-top:0;margin-top:0;margin-left:auto}.uq-card--icon-nav .uq-card__description,.uq-card--icon-nav .uq-story-card__description{display:none}.uq-card--icon-nav .uq-card__icon{margin:0 1rem 0 0}.uq-card--icon-nav .uq-card__icon .uq-icon::before{height:40px;width:40px}}@media(max-width: 37.4375rem){.uq-story-card{border-radius:0;border-inline-width:0;border-top-width:0;display:flex;flex-direction:row-reverse;align-items:center;gap:1rem;padding-bottom:1rem;background-color:rgba(0,0,0,0)}.uq-story-card:hover{background-color:rgba(0,0,0,0)}}.uq-story-card__content{flex:1;position:relative;display:flex;flex-direction:column;padding:1.5rem}@media(max-width: 37.4375rem){.uq-story-card__content{padding:0}}@media(max-width: 37.4375rem){.uq-story-card__title{-webkit-line-clamp:3}}@media(max-width: 37.4375rem){.uq-story-card__description{display:none}}.uq-story-card__top-label{margin-bottom:.25rem;color:#757377;font-weight:500}@media(max-width: 37.4375rem){.uq-story-card__top-label{margin-bottom:0}}.uq-story-card__bottom-label{padding-top:1.5rem;margin-top:auto}@media(max-width: 37.4375rem){.uq-story-card__bottom-label{margin-top:.5rem}}@media(max-width: 37.4375rem){.uq-story-card__image{width:120px;height:100px;aspect-ratio:unset;flex-shrink:0}}.uq-story-card--event .uq-story-card__top-label{color:#51247a}.uq-story-card--event .uq-story-card__description,.uq-story-card--story .uq-story-card__description{display:none}
1
+ :root{--card-title-font-size: 24px}@media(max-width: 37.4375rem){:root{--card-title-font-size: 22px}}.uq-card,.uq-story-card{position:relative;display:flex;flex-direction:column;border-radius:4px;border:1px solid #dcdcdd;background:#fff}.uq-card:has(a:focus-visible),.uq-story-card:has(a:focus-visible){outline:4px solid #0d6dcd;outline-offset:-1px}.uq-card:has(a:hover),.uq-story-card:has(a:hover){background:#f3f3f4}.uq-card:has(a:hover) .uq-card__content::after,.uq-story-card:has(a:hover) .uq-card__content::after{left:8px}.uq-card__content{flex:1;display:flex;flex-direction:column;padding:1.5rem}.uq-card__content::after{content:"";height:calc(24px + 1.5rem);width:24px;margin-top:auto;position:relative;background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4 12h15M14 18l6-6-6-6' stroke='%2351247a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e");background-position:right bottom;background-size:24px;background-repeat:no-repeat;transition:left 200ms ease-in-out;left:0}.uq-card__title,.uq-story-card__title{margin:0;color:#19151c;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden;font-size:var(--card-title-font-size)}.uq-card__title a,.uq-story-card__title a{color:#19151c;text-decoration:none}.uq-card__title a::after,.uq-story-card__title a::after{content:"";position:absolute;inset:0}.uq-card__title a:focus,.uq-story-card__title a:focus{outline:none}.uq-card__title a:hover,.uq-story-card__title a:hover{color:#19151c;text-decoration:underline;background-color:rgba(0,0,0,0)}.uq-card__description,.uq-story-card__description{margin-top:.5rem}.uq-card__image,.uq-story-card__image{aspect-ratio:1.5/1;position:relative;flex-shrink:0}.uq-card__image img,.uq-story-card__image img,.uq-card__image picture,.uq-story-card__image picture{width:100%;height:100%;inset:0;position:absolute;object-fit:cover}.uq-card__icon{margin-bottom:.5rem}.uq-card__icon .uq-icon::before{height:56px;width:56px}.uq-card--text .uq-card__image,.uq-card--text .uq-story-card__image,.uq-card--text .uq-card__icon{display:none}.uq-card--image .uq-card__icon{display:none}.uq-card--icon .uq-card__image,.uq-card--icon .uq-story-card__image,.uq-card--icon-nav .uq-card__image,.uq-card--icon-nav .uq-story-card__image{display:none}@media(max-width: 37.4375rem){.uq-card--icon-nav .uq-card__content{display:flex;align-items:center;flex-direction:row}.uq-card--icon-nav .uq-card__content::after{height:24px;margin-top:0;margin-left:auto}.uq-card--icon-nav .uq-card__description,.uq-card--icon-nav .uq-story-card__description{display:none}.uq-card--icon-nav .uq-card__icon{margin:0 1rem 0 0}.uq-card--icon-nav .uq-card__icon .uq-icon::before{height:40px;width:40px}}@container (width > 667px){.uq-card-grid--target-1x .uq-card,.uq-card-grid--target-1x .uq-story-card{display:flex;flex-direction:row-reverse;gap:var(--layout-gap);align-items:center}.uq-card-grid--target-1x .uq-card__image,.uq-card-grid--target-1x .uq-story-card__image{width:50%;height:100%}.uq-card-grid--target-1x .uq-card__content{width:50%;padding-inline:1.5rem 0}}.uq-story-card__content{flex:1;display:flex;flex-direction:column;padding:1.5rem}.uq-story-card__top-label{margin-bottom:.25rem;color:#757377;font-weight:500}.uq-story-card__bottom-label{padding-top:1.5rem;margin-top:auto}.uq-story-card--event .uq-story-card__top-label{color:#51247a}.uq-story-card--event .uq-story-card__description,.uq-story-card--story .uq-story-card__description{display:none}@media(max-width: 37.4375rem){.uq-card-grid:not(.uq-card-grid--target-1x) .uq-story-card{border-radius:0;border-inline-width:0;border-top-width:0;display:flex;flex-direction:row-reverse;align-items:center;gap:1rem;padding-bottom:1rem;background-color:rgba(0,0,0,0)}.uq-card-grid:not(.uq-card-grid--target-1x) .uq-story-card:hover{background-color:rgba(0,0,0,0)}.uq-card-grid:not(.uq-card-grid--target-1x) .uq-story-card__content{padding:0}.uq-card-grid:not(.uq-card-grid--target-1x) .uq-story-card__image{width:120px;height:100px;aspect-ratio:unset;flex-shrink:0}.uq-card-grid:not(.uq-card-grid--target-1x) .uq-story-card__title{-webkit-line-clamp:3}.uq-card-grid:not(.uq-card-grid--target-1x) .uq-story-card__description{display:none}.uq-card-grid:not(.uq-card-grid--target-1x) .uq-story-card__top-label{margin-bottom:0}.uq-card-grid:not(.uq-card-grid--target-1x) .uq-story-card__bottom-label{padding-top:.5rem}}.uq-card-grid--target-1x .uq-story-card .uq-story-card__description{display:block}@container (width > 667px){.uq-card-grid--target-1x .uq-story-card{display:flex;flex-direction:row-reverse;gap:var(--layout-gap);align-items:center}.uq-card-grid--target-1x .uq-story-card__image{width:50%;height:100%}.uq-card-grid--target-1x .uq-story-card__content{width:50%;padding-inline:1.5rem 0}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uqds/card",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.4",
4
4
  "description": "Card components",
5
5
  "keywords": [
6
6
  "uqds",
@@ -29,6 +29,7 @@
29
29
  "src/*",
30
30
  "dist/*"
31
31
  ],
32
+ "style": "dist/css/main.css",
32
33
  "scripts": {
33
34
  "prepare": "gulp -f ../../gulpfile.js --cwd=. prepare"
34
35
  },
@@ -41,7 +42,8 @@
41
42
  },
42
43
  "dependencies": {
43
44
  "@uqds/core": "^1.2.0-alpha.1",
44
- "@uqds/icon": "^0.0.15-alpha.5"
45
+ "@uqds/icon": "^0.0.15-alpha.7",
46
+ "@uqds/layout": "^1.0.0-alpha.9"
45
47
  },
46
- "gitHead": "3b41c2842c6e11853d433f37392e5dae72566555"
48
+ "gitHead": "59b7cdd7305dd3aa0f00de03b0ee39a7026bb6ad"
47
49
  }
@@ -1,5 +1,6 @@
1
1
  @use "@uqds/core/src/scss/global" as core;
2
2
  @use "@uqds/icon/src/scss/global" as icon;
3
+ @use "@uqds/layout/src/scss/global" as layout;
3
4
 
4
5
  .uq-card {
5
6
  position: relative;
@@ -14,7 +15,7 @@
14
15
  outline-offset: -1px;
15
16
  }
16
17
 
17
- &:hover {
18
+ &:has(a:hover) {
18
19
  background: core.$grey-50;
19
20
 
20
21
  & .uq-card__content::after {
@@ -31,12 +32,10 @@
31
32
 
32
33
  &::after {
33
34
  content: "";
34
- height: 24px;
35
+ height: calc(24px + core.$space-l);
35
36
  width: 24px;
36
37
  margin-top: auto;
37
- padding-top: core.$space-l;
38
38
  position: relative;
39
- box-sizing: content-box;
40
39
  background-image: url(icon.get-icon(
41
40
  "standard--arrow-right",
42
41
  core.$purple-500
@@ -49,7 +48,6 @@
49
48
  }
50
49
  }
51
50
 
52
- %uq-card__title,
53
51
  .uq-card__title {
54
52
  margin: 0;
55
53
  color: core.$black;
@@ -61,6 +59,7 @@
61
59
 
62
60
  & a {
63
61
  color: core.$black;
62
+ text-decoration: none;
64
63
 
65
64
  &::after {
66
65
  content: "";
@@ -73,6 +72,8 @@
73
72
  }
74
73
 
75
74
  &:hover {
75
+ color: core.$black;
76
+ text-decoration: underline;
76
77
  background-color: transparent;
77
78
  }
78
79
  }
@@ -134,7 +135,7 @@
134
135
  flex-direction: row;
135
136
 
136
137
  &::after {
137
- padding-top: 0;
138
+ height: 24px;
138
139
  margin-top: 0;
139
140
  margin-left: auto;
140
141
  }
@@ -154,3 +155,24 @@
154
155
  }
155
156
  }
156
157
  }
158
+
159
+ .uq-card-grid--target-1x {
160
+ @container (width > #{layout.$card-grid-container-md}) {
161
+ & .uq-card {
162
+ display: flex;
163
+ flex-direction: row-reverse;
164
+ gap: var(--layout-gap);
165
+ align-items: center;
166
+ }
167
+
168
+ & .uq-card__image {
169
+ width: 50%;
170
+ height: 100%;
171
+ }
172
+
173
+ & .uq-card__content {
174
+ width: 50%;
175
+ padding-inline: core.$space-l 0;
176
+ }
177
+ }
178
+ }
@@ -1,82 +1,39 @@
1
1
  @use "@uqds/core/src/scss/global" as core;
2
+ @use "@uqds/layout/src/scss/global" as layout;
2
3
  @use "card";
3
4
 
4
5
  .uq-story-card {
5
6
  @extend .uq-card;
6
-
7
- @media #{core.$screen-md-down} {
8
- border-radius: 0;
9
- border-inline-width: 0;
10
- border-top-width: 0;
11
- display: flex;
12
- flex-direction: row-reverse;
13
- align-items: center;
14
- gap: core.$space-m;
15
- padding-bottom: core.$space-m;
16
- background-color: transparent;
17
-
18
- &:hover {
19
- background-color: transparent;
20
- }
21
- }
22
7
  }
23
8
 
24
9
  .uq-story-card__content {
25
10
  flex: 1;
26
- position: relative;
27
11
  display: flex;
28
12
  flex-direction: column;
29
13
  padding: core.$space-l;
30
-
31
- @media #{core.$screen-md-down} {
32
- padding: 0;
33
- }
34
14
  }
35
15
 
36
16
  .uq-story-card__title {
37
- @extend %uq-card__title;
38
-
39
- @media #{core.$screen-md-down} {
40
- -webkit-line-clamp: 3;
41
- }
17
+ @extend .uq-card__title;
42
18
  }
43
19
 
44
20
  .uq-story-card__description {
45
21
  @extend .uq-card__description;
46
-
47
- @media #{core.$screen-md-down} {
48
- display: none;
49
- }
50
22
  }
51
23
 
52
24
  .uq-story-card__top-label {
53
25
  margin-bottom: core.$space-xs;
54
26
  color: core.$grey-700;
55
27
  font-weight: core.$font-weight-medium;
56
-
57
- @media #{core.$screen-md-down} {
58
- margin-bottom: 0;
59
- }
60
28
  }
61
29
 
62
30
  .uq-story-card__bottom-label {
63
31
  padding-top: core.$space-l;
64
32
  margin-top: auto;
65
-
66
- @media #{core.$screen-md-down} {
67
- margin-top: core.$space-s;
68
- }
69
33
  }
70
34
 
71
35
  .uq-story-card__image {
72
36
  @extend .uq-card__image;
73
-
74
- @media #{core.$screen-md-down} {
75
- width: 120px;
76
- height: 100px;
77
- aspect-ratio: unset;
78
- flex-shrink: 0;
79
- }
80
37
  }
81
38
 
82
39
  .uq-story-card--event {
@@ -91,3 +48,77 @@
91
48
  display: none;
92
49
  }
93
50
  }
51
+
52
+ .uq-card-grid:not(.uq-card-grid--target-1x) {
53
+ @media #{core.$screen-md-down} {
54
+ & .uq-story-card {
55
+ border-radius: 0;
56
+ border-inline-width: 0;
57
+ border-top-width: 0;
58
+ display: flex;
59
+ flex-direction: row-reverse;
60
+ align-items: center;
61
+ gap: core.$space-m;
62
+ padding-bottom: core.$space-m;
63
+ background-color: transparent;
64
+
65
+ &:hover {
66
+ background-color: transparent;
67
+ }
68
+ }
69
+
70
+ .uq-story-card__content {
71
+ padding: 0;
72
+ }
73
+
74
+ & .uq-story-card__image {
75
+ width: 120px;
76
+ height: 100px;
77
+ aspect-ratio: unset;
78
+ flex-shrink: 0;
79
+ }
80
+
81
+ .uq-story-card__title {
82
+ -webkit-line-clamp: 3;
83
+ }
84
+
85
+ .uq-story-card__description {
86
+ display: none;
87
+ }
88
+
89
+ .uq-story-card__top-label {
90
+ margin-bottom: 0;
91
+ }
92
+
93
+ .uq-story-card__bottom-label {
94
+ padding-top: core.$space-s;
95
+ }
96
+ }
97
+ }
98
+
99
+ .uq-card-grid--target-1x {
100
+ & .uq-story-card {
101
+ & .uq-story-card__description {
102
+ display: block;
103
+ }
104
+ }
105
+
106
+ @container (width > #{layout.$card-grid-container-md}) {
107
+ & .uq-story-card {
108
+ display: flex;
109
+ flex-direction: row-reverse;
110
+ gap: var(--layout-gap);
111
+ align-items: center;
112
+ }
113
+
114
+ & .uq-story-card__image {
115
+ width: 50%;
116
+ height: 100%;
117
+ }
118
+
119
+ & .uq-story-card__content {
120
+ width: 50%;
121
+ padding-inline: core.$space-l 0;
122
+ }
123
+ }
124
+ }