@uqds/card 0.1.0-alpha.1 → 0.1.0-alpha.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/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-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: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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uqds/card",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.2",
4
4
  "description": "Card components",
5
5
  "keywords": [
6
6
  "uqds",
@@ -40,8 +40,8 @@
40
40
  "url": "https://github.com/uq-its-ss/design-system/issues"
41
41
  },
42
42
  "dependencies": {
43
- "@uqds/core": "^1.2.0-alpha.0",
44
- "@uqds/icon": "^0.0.15-alpha.4"
43
+ "@uqds/core": "^1.2.0-alpha.1",
44
+ "@uqds/icon": "^0.0.15-alpha.5"
45
45
  },
46
- "gitHead": "0a1a6e48689f330d9cb6ac9d0d47b8f8a4edf2ff"
46
+ "gitHead": "3b41c2842c6e11853d433f37392e5dae72566555"
47
47
  }
@@ -71,6 +71,10 @@
71
71
  &:focus {
72
72
  outline: none;
73
73
  }
74
+
75
+ &:hover {
76
+ background-color: transparent;
77
+ }
74
78
  }
75
79
  }
76
80
 
@@ -0,0 +1,225 @@
1
+ @use "@uqds/core/src/scss/global" as core;
2
+ @use "global" as *;
3
+
4
+ // Card Default
5
+ .uq-card {
6
+ position: relative;
7
+ display: flex;
8
+ flex-direction: column;
9
+ font-family: core.$font-body;
10
+ font-size: core.$font-size-m;
11
+ font-weight: core.$font-weight-normal;
12
+ line-height: core.$line-height;
13
+ height: 100%;
14
+ background-color: core.$white;
15
+ border: 1px solid core.$grey-200;
16
+ border-radius: core.$space-xs;
17
+ color: core.$grey-900;
18
+ line-height: core.$space-l;
19
+ overflow-wrap: break-word;
20
+ word-wrap: break-word;
21
+
22
+ // Link that wraps the whole card
23
+ &__link {
24
+ position: absolute;
25
+ top: 0;
26
+ right: 0;
27
+ bottom: 0;
28
+ left: 0;
29
+ text-indent: -1000%;
30
+ box-shadow: 0 core.$space-xs core.$space-xs rgba(core.$grey-900, 0.05);
31
+ transition: all ease 0.25s;
32
+ z-index: 10;
33
+
34
+ &:hover,
35
+ &:focus {
36
+ background-color: transparent;
37
+ box-shadow: 0 core.$space-s core.$space-m rgba(core.$grey-900, 0.15);
38
+ }
39
+ }
40
+
41
+ &__image-wrapper {
42
+ max-height: 190px;
43
+ overflow: hidden;
44
+
45
+ @media #{core.$screen-md-up} {
46
+ max-height: 15rem;
47
+ }
48
+ }
49
+ &__image {
50
+ position: relative;
51
+ padding-bottom: 70%;
52
+ overflow: hidden;
53
+
54
+ img {
55
+ position: absolute;
56
+ top: 50%;
57
+ left: 50%;
58
+ width: 100%;
59
+ transform: translate(-50%, -50%);
60
+ -o-object-fit: cover;
61
+ object-fit: cover;
62
+ z-index: 0;
63
+ }
64
+ }
65
+
66
+ &__content-wrapper {
67
+ display: flex;
68
+ flex-direction: column;
69
+ flex-grow: 1;
70
+ }
71
+ &__content {
72
+ flex-grow: 1;
73
+ padding: core.$space-l;
74
+
75
+ :last-child .uq-card__title {
76
+ margin-bottom: core.$space-none;
77
+ }
78
+ }
79
+
80
+ &__header {
81
+ :last-child {
82
+ margin: core.$space-none core.$space-none core.$space-s;
83
+ }
84
+ }
85
+
86
+ &__body {
87
+ p {
88
+ margin-top: 0;
89
+ }
90
+ p:last-child {
91
+ margin-bottom: core.$space-none;
92
+ }
93
+ }
94
+
95
+ &__actions {
96
+ padding: core.$space-none core.$space-l core.$space-l;
97
+
98
+ p:last-child {
99
+ margin-bottom: core.$space-none;
100
+ }
101
+ }
102
+
103
+ &__title {
104
+ font-size: core.$font-size-xl;
105
+ color: core.$grey-900;
106
+ margin: core.$space-none core.$space-none core.$space-s;
107
+
108
+ @media #{core.$screen-md-up} {
109
+ font-size: core.$font-size-xxl;
110
+ }
111
+
112
+ &-super {
113
+ font-size: core.$font-size-s;
114
+ font-weight: 500;
115
+ color: core.$purple-light;
116
+ text-transform: uppercase;
117
+ margin: core.$space-none core.$space-none core.$space-s;
118
+
119
+ @media #{core.$screen-md-up} {
120
+ font-size: core.$font-size-m;
121
+ }
122
+
123
+ &--grey {
124
+ font-weight: 400;
125
+ color: core.$grey-800;
126
+ }
127
+ }
128
+ }
129
+
130
+ // Shaded
131
+ &--shaded {
132
+ background-color: core.$grey-50;
133
+ }
134
+ }
135
+
136
+ /* Additional style rules */
137
+ .uq-grid {
138
+ // On smaller viewports, Story & Event cards when > 3 renders as lists
139
+ @media #{core.$screen-md-down} {
140
+ &__col {
141
+ // When there are 3 items
142
+ @include with-count(3) {
143
+ @include card-list-style();
144
+ }
145
+
146
+ // When there are 4 items
147
+ @include with-count(4) {
148
+ @include card-list-style();
149
+ }
150
+ }
151
+ }
152
+
153
+ // Full width cards
154
+ &__col--md-8,
155
+ &__col--xl-12 {
156
+ .uq-card {
157
+ @media #{core.$screen-md-up} {
158
+ flex-direction: row;
159
+ }
160
+
161
+ &__image-wrapper {
162
+ min-width: 100%;
163
+ overflow: hidden;
164
+
165
+ @media #{core.$screen-md-up} {
166
+ min-width: 50%;
167
+ max-height: 100%;
168
+ }
169
+ }
170
+ &__image {
171
+ padding-bottom: 70%;
172
+
173
+ @media #{core.$screen-md-up} {
174
+ min-height: 100%;
175
+ padding-bottom: 0%;
176
+ }
177
+ }
178
+ &__content-wrapper {
179
+ min-width: 100%;
180
+
181
+ @media #{core.$screen-md-up} {
182
+ min-width: 50%;
183
+ }
184
+ }
185
+ &__content {
186
+ padding: core.$space-l;
187
+
188
+ @media #{core.$screen-md-up} {
189
+ padding: core.$space-xxxxl core.$space-xxxxl core.$space-l;
190
+ }
191
+ }
192
+ &__body {
193
+ p {
194
+ @include truncate-card-1col-body-text;
195
+ }
196
+ }
197
+
198
+ &__actions {
199
+ padding: core.$space-none core.$space-l core.$space-l;
200
+
201
+ @media #{core.$screen-md-up} {
202
+ padding: core.$space-none core.$space-xxxxl core.$space-xxxxl;
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+
209
+ // Set height of card to not equalise
210
+ .height-non-equalised .uq-card {
211
+ height: auto;
212
+ }
213
+
214
+ // This should be replaced with a component specfic class or removed and documented as a body package dependancy for usage with cards.
215
+ .text--link {
216
+ color: core.$purple-500;
217
+ text-decoration: none;
218
+ transition: 0.2s color;
219
+
220
+ &:hover {
221
+ background-color: core.$purple-500;
222
+ color: core.$white;
223
+ text-decoration: underline;
224
+ }
225
+ }