@uqds/hero 0.1.0-alpha.0 → 1.0.0-alpha.0

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
- .uq-hero{position:relative;background-color:#51247a;font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:1rem;font-weight:500;line-height:1.5}.uq-hero__content{margin-left:1rem;margin-right:1rem;padding-left:.5rem;padding-right:.5rem;color:#fff;padding-top:3rem;padding-bottom:3rem;position:relative;z-index:2}@media(min-width: 32.5rem){.uq-hero__content{margin-left:auto;margin-right:auto;max-width:30.5rem}}@media(min-width: 37.5rem){.uq-hero__content{margin-left:3.25rem;margin-right:3.25rem;max-width:none}}@media(min-width: 64.25rem){.uq-hero__content{margin-left:auto;margin-right:auto;max-width:57.75rem}}@media(min-width: 75rem){.uq-hero__content{margin-left:8.375rem;margin-right:8.375rem;max-width:none}}@media(min-width: 90rem){.uq-hero__content{margin-left:auto;margin-right:auto;max-width:73.25rem}}@media(min-width: 37.5rem){.uq-hero__content{padding-left:.75rem;padding-right:.75rem}}@media(min-width: 75rem){.uq-hero__content{padding-left:1rem;padding-right:1rem}}@media(min-width: 37.5rem){.uq-hero__content{padding-top:6.5rem;padding-bottom:6.5rem}}.uq-hero__text .uq-hero__title{color:inherit;font-family:"Montserrat",Helvetica,Arial,sans-serif;font-size:2rem;margin-top:0;margin-bottom:.5rem}@media(min-width: 37.5rem){.uq-hero__text .uq-hero__title{font-size:2.5rem}}.uq-hero__text *:last-child{margin-bottom:0}.uq-hero__subtext{margin-bottom:1.5rem}.uq-hero__image{position:absolute;top:0;left:0;right:0;bottom:0;z-index:0}.uq-hero__image picture,.uq-hero__image img{position:absolute;height:100%;width:100%;top:0;left:0;object-fit:cover}.uq-hero__image::before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(100deg, rgb(81, 36, 122) 36%, transparent 70%);mix-blend-mode:normal;opacity:1;z-index:1}@media(min-width: 37.5rem){.uq-hero__image--small{display:none}}.uq-hero__image--small img{position:relative;height:auto}.uq-hero__image--large{display:none}@media(min-width: 37.5rem){.uq-hero__image--large{display:block}}@media(max-width: 37.4375rem){.uq-hero__image{position:relative;min-height:6rem}.uq-hero__image::before{background:linear-gradient(360deg, rgb(81, 36, 122) 3%, transparent 50%)}}.uq-hero--feature-image .uq-hero__content{padding-top:0}@media(min-width: 37.5rem){.uq-hero--feature-image .uq-hero__content{padding-top:6.5rem}}@media(min-width: 37.5rem){.uq-hero--feature-image .hero__text{width:50%}}@media(min-width: 37.5rem){.uq-hero--large .uq-hero__content{padding-top:10rem;padding-bottom:10rem}}
1
+ :root{--font-size-ul: 3rem;--hero-spacing: 4.5rem;--hero-basic-spacing: 5rem;--hero-aspect-ratio: 2.35 / 1;--hero-large-aspect-ratio: 3 / 2;--hero-min-height: 336px;--hero-large-min-height: 500px;--hero-image-max-width: 790px}@media(max-width: 63.9375rem){:root{--font-size-ul: 30px;--hero-basic-spacing: 2rem}}.uq-hero{background:#4b2271}@media(min-width: 64rem){.uq-hero{position:relative;padding:var(--hero-spacing) 0;min-height:var(--hero-min-height);display:flex;align-items:center}}@media(max-width: 63.9375rem){.uq-hero .uq-container{margin:0;padding:0}}.uq-hero__image{display:flex}@media(min-width: 64rem){.uq-hero__image{position:absolute;z-index:1;left:0;top:0;width:100%;height:100%}}@media(min-width: 64rem){.uq-hero__image::before{content:"";width:calc(50% - 3rem);flex-shrink:1}}.uq-hero__image img,.uq-hero__image picture{object-fit:cover;aspect-ratio:var(--hero-aspect-ratio);width:100%}@media(min-width: 64rem){.uq-hero__image img,.uq-hero__image picture{width:auto;height:100%;flex-shrink:0;max-width:var(--hero-image-max-width)}}.uq-hero__content{position:relative;background:#51247a;box-shadow:0 3px 24px 0 rgba(24,24,24,.1);padding:var(--layout-gap);margin-bottom:8px}@media(min-width: 64rem){.uq-hero__content{z-index:2;width:586px}}.uq-hero__content *{margin:0}.uq-hero__content::after{position:absolute;top:100%;left:0;content:"";height:8px;width:100%;border-radius:0 0 4px 4px;background:#40205d}.uq-hero__title{color:#fff}.uq-hero__description{margin-top:1rem;font-size:1.125rem;color:#fff}.uq-hero__description,.uq-hero__description *{color:#fff;font-size:1.125rem}.uq-hero__button{margin-top:1.5rem}.uq-hero--light{background:unset}.uq-hero--light .uq-hero__content{background:#fff}.uq-hero--light .uq-hero__content::after{background:linear-gradient(90deg, #51247a 0%, 87%, #962a8b 100%)}.uq-hero--light .uq-hero__title{color:#51247a}.uq-hero--light .uq-hero__description,.uq-hero--light .uq-hero__description *{color:unset}@media(min-width: 64rem){.uq-hero--large{min-height:var(--hero-large-min-height)}}.uq-hero--large .uq-hero__image img,.uq-hero--large .uq-hero__image picture{aspect-ratio:var(--hero-large-aspect-ratio)}.uq-hero--large .uq-hero__title{font-size:var(--font-size-ul)}.uq-hero-basic{background:#4b2271;position:relative}.uq-hero-basic__image{position:absolute;opacity:.2;width:100%;height:100%;top:0;left:0;z-index:1}.uq-hero-basic__image img,.uq-hero-basic__image picture{object-fit:cover;height:100%;width:100%;display:block}.uq-hero-basic__content{position:relative;z-index:2;color:#fff;padding:var(--hero-basic-spacing) 0}.uq-hero-basic__content a{color:#fff}.uq-hero-basic__eyebrow{font-weight:500;font-size:1rem;line-height:1.5;font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif;text-transform:uppercase;display:block}.uq-hero-basic__title{font-size:var(--font-size-ul);color:#fff;margin:0}.uq-hero-basic__back{margin-top:.5rem}.uq-hero-basic__back .uq-icon::before{width:16px;height:19px}.uq-hero-basic__tabs{position:relative;z-index:2;padding-top:1rem}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uqds/hero",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "1.0.0-alpha.0",
4
4
  "description": "Hero component",
5
5
  "keywords": [
6
6
  "uqds",
@@ -44,5 +44,5 @@
44
44
  "@uqds/core": "^1.2.0-alpha.0",
45
45
  "@uqds/grid": "^0.0.15-alpha.2"
46
46
  },
47
- "gitHead": "78891f49ec037688e08f67f30a52691404325da7"
47
+ "gitHead": "f2f4a0823e08482e73c1496dd17f00d4c971b4ca"
48
48
  }
@@ -0,0 +1,25 @@
1
+ @use "@uqds/core/src/scss/global" as core;
2
+
3
+ :root {
4
+ --font-size-ul: #{core.$font-size-ul};
5
+
6
+ --hero-spacing: #{core.$space-uul};
7
+ --hero-basic-spacing: #{core.$space-uuul};
8
+
9
+ --hero-aspect-ratio: 2.35 / 1;
10
+ --hero-large-aspect-ratio: 3 / 2;
11
+
12
+ --hero-min-height: 336px;
13
+ --hero-large-min-height: 500px;
14
+
15
+ --hero-image-max-width: 790px;
16
+ }
17
+
18
+ // Resize custom properties for tablet/mobile.
19
+ @media #{core.$screen-lg-down} {
20
+ :root {
21
+ --font-size-ul: 30px;
22
+
23
+ --hero-basic-spacing: #{core.$space-xl};
24
+ }
25
+ }
@@ -0,0 +1,68 @@
1
+ @use "@uqds/core/src/scss/global" as core;
2
+ @use "@uqds/grid/src/scss/global" as grid;
3
+
4
+ .uq-hero-basic {
5
+ background: core.$purple-600;
6
+ position: relative;
7
+ }
8
+
9
+ .uq-hero-basic__image {
10
+ position: absolute;
11
+ opacity: 0.2;
12
+ width: 100%;
13
+ height: 100%;
14
+ top: 0;
15
+ left: 0;
16
+ z-index: 1;
17
+
18
+ & img,
19
+ & picture {
20
+ object-fit: cover;
21
+ height: 100%;
22
+ width: 100%;
23
+ display: block;
24
+ }
25
+ }
26
+
27
+ .uq-hero-basic__content {
28
+ position: relative;
29
+ z-index: 2;
30
+ color: core.$white;
31
+ padding: var(--hero-basic-spacing) 0;
32
+
33
+ & a {
34
+ color: core.$white;
35
+ }
36
+ }
37
+
38
+ .uq-hero-basic__eyebrow {
39
+ font-weight: core.$font-weight-medium;
40
+ font-size: core.$font-size-m;
41
+ line-height: core.$line-height;
42
+ font-family: core.$font-body;
43
+ text-transform: uppercase;
44
+ display: block;
45
+ }
46
+
47
+ .uq-hero-basic__title {
48
+ font-size: var(--font-size-ul);
49
+ color: core.$white;
50
+ margin: 0;
51
+ }
52
+
53
+ .uq-hero-basic__back {
54
+ margin-top: core.$space-s;
55
+
56
+ & .uq-icon::before {
57
+ // Lock icon width to 16px.
58
+ width: 16px;
59
+ // Allow height to match <a> element.
60
+ height: 19px;
61
+ }
62
+ }
63
+
64
+ .uq-hero-basic__tabs {
65
+ position: relative;
66
+ z-index: 2;
67
+ padding-top: core.$space-m;
68
+ }
@@ -0,0 +1,152 @@
1
+ @use "@uqds/core/src/scss/global" as core;
2
+ @use "@uqds/grid/src/scss/global" as grid;
3
+
4
+ .uq-hero {
5
+ background: core.$purple-600;
6
+
7
+ @media #{core.$screen-lg-up} {
8
+ position: relative;
9
+ // On desktop the we set a min height and top/bottom padding.
10
+ // This will ensure heros expand in height when there is too much text.
11
+ padding: var(--hero-spacing) 0;
12
+ min-height: var(--hero-min-height);
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ & .uq-container {
18
+ // On mobile/tablet .uq-hero__content provides padding and the
19
+ // container gutters are no longer needed.
20
+ @media #{core.$screen-lg-down} {
21
+ margin: 0;
22
+ padding: 0;
23
+ }
24
+ }
25
+ }
26
+
27
+ .uq-hero__image {
28
+ display: flex;
29
+
30
+ @media #{core.$screen-lg-up} {
31
+ position: absolute;
32
+ z-index: 1;
33
+ left: 0;
34
+ top: 0;
35
+ width: 100%;
36
+ height: 100%;
37
+ }
38
+
39
+ &::before {
40
+ @media #{core.$screen-lg-up} {
41
+ content: "";
42
+ width: calc(50% - #{core.$space-xxxl});
43
+ flex-shrink: 1;
44
+ }
45
+ }
46
+
47
+ & img,
48
+ & picture {
49
+ object-fit: cover;
50
+ // The hero image uses this standard aspect ratio so it is always the
51
+ // same size.
52
+ aspect-ratio: var(--hero-aspect-ratio);
53
+ // On tablet/mobile the image size is based off the width of the page.
54
+ width: 100%;
55
+
56
+ @media #{core.$screen-lg-up} {
57
+ // On desktop the image size is based off the height of the hero.
58
+ width: auto;
59
+ height: 100%;
60
+ flex-shrink: 0;
61
+ // Set a max width which will ensure the image doesn't get too wide for
62
+ // heros that container a large amount of text.
63
+ max-width: var(--hero-image-max-width);
64
+ }
65
+ }
66
+ }
67
+
68
+ .uq-hero__content {
69
+ position: relative;
70
+ background: core.$purple-500;
71
+ box-shadow: 0 3px 24px 0 rgba(#181818, 0.1);
72
+ padding: var(--layout-gap);
73
+ margin-bottom: 8px;
74
+
75
+ @media #{core.$screen-lg-up} {
76
+ z-index: 2;
77
+ width: 586px;
78
+ }
79
+
80
+ & * {
81
+ margin: 0;
82
+ }
83
+
84
+ &::after {
85
+ position: absolute;
86
+ top: 100%;
87
+ left: 0;
88
+ content: "";
89
+ height: 8px;
90
+ width: 100%;
91
+ border-radius: 0 0 4px 4px;
92
+ background: core.$purple-650;
93
+ }
94
+ }
95
+
96
+ .uq-hero__title {
97
+ color: core.$white;
98
+ }
99
+
100
+ .uq-hero__description {
101
+ margin-top: core.$space-m;
102
+ font-size: core.$font-size-l;
103
+ color: core.$white;
104
+ }
105
+
106
+ .uq-hero__description,
107
+ .uq-hero__description * {
108
+ color: core.$white;
109
+ font-size: core.$font-size-l;
110
+ }
111
+
112
+ .uq-hero__button {
113
+ margin-top: core.$space-l;
114
+ }
115
+
116
+ .uq-hero--light {
117
+ background: unset;
118
+
119
+ & .uq-hero__content {
120
+ background: core.$white;
121
+
122
+ &::after {
123
+ background: core.$purple-gradient;
124
+ }
125
+ }
126
+
127
+ & .uq-hero__title {
128
+ color: core.$purple-500;
129
+ }
130
+
131
+ & .uq-hero__description,
132
+ & .uq-hero__description * {
133
+ color: unset;
134
+ }
135
+ }
136
+
137
+ .uq-hero--large {
138
+ @media #{core.$screen-lg-up} {
139
+ min-height: var(--hero-large-min-height);
140
+ }
141
+
142
+ & .uq-hero__image {
143
+ & img,
144
+ & picture {
145
+ aspect-ratio: var(--hero-large-aspect-ratio);
146
+ }
147
+ }
148
+
149
+ & .uq-hero__title {
150
+ font-size: var(--font-size-ul);
151
+ }
152
+ }
@@ -1 +1,3 @@
1
- @use "component";
1
+ @use "custom-properties";
2
+ @use "hero";
3
+ @use "hero-basic";
@@ -1,144 +0,0 @@
1
- @use "@uqds/core/src/scss/global" as core;
2
- @use "@uqds/grid/src/scss/global" as grid;
3
-
4
- // Hero
5
-
6
- .uq-hero {
7
- position: relative;
8
- background-color: core.$purple-500;
9
- font-family: core.$font-body;
10
- font-size: core.$font-size-m;
11
- font-weight: core.$font-weight-medium;
12
- line-height: core.$line-height;
13
-
14
- &__content {
15
- @include grid.layout-containment;
16
- @include grid.grid-col-padding;
17
- color: white;
18
- padding-top: 3rem;
19
- padding-bottom: 3rem;
20
- position: relative;
21
- z-index: 2;
22
-
23
- @media #{core.$screen-md-up} {
24
- padding-top: 6.5rem;
25
- padding-bottom: 6.5rem;
26
- }
27
- }
28
-
29
- &__text {
30
- & .uq-hero__title {
31
- color: inherit;
32
- font-family: core.$montserrat;
33
- font-size: core.$font-size-xxxl;
34
- margin-top: 0;
35
- margin-bottom: core.$space-s;
36
-
37
- @media #{core.$screen-md-up} {
38
- font-size: core.$font-size-xxxxl;
39
- }
40
- }
41
-
42
- & *:last-child {
43
- margin-bottom: 0;
44
- }
45
- }
46
-
47
- &__subtext {
48
- margin-bottom: core.$space-l;
49
- }
50
-
51
- &__image {
52
- position: absolute;
53
- top: 0;
54
- left: 0;
55
- right: 0;
56
- bottom: 0;
57
- z-index: 0;
58
-
59
- & picture,
60
- & img {
61
- position: absolute;
62
- height: 100%;
63
- width: 100%;
64
- top: 0;
65
- left: 0;
66
- object-fit: cover;
67
- }
68
-
69
- &::before {
70
- content: "";
71
- display: block;
72
- position: absolute;
73
- top: 0;
74
- left: 0;
75
- width: 100%;
76
- height: 100%;
77
- background: linear-gradient(
78
- 100deg,
79
- rgb(81, 36, 122) 36%,
80
- transparent 70%
81
- );
82
- mix-blend-mode: normal;
83
- opacity: 1;
84
- z-index: 1;
85
- }
86
-
87
- &--small {
88
- @media #{core.$screen-md-up} {
89
- display: none;
90
- }
91
-
92
- & img {
93
- position: relative;
94
- height: auto;
95
- }
96
- }
97
-
98
- &--large {
99
- display: none;
100
-
101
- @media #{core.$screen-md-up} {
102
- display: block;
103
- }
104
- }
105
-
106
- @media #{core.$screen-md-down} {
107
- position: relative;
108
- min-height: 6rem;
109
-
110
- &::before {
111
- background: linear-gradient(
112
- 360deg,
113
- rgb(81, 36, 122) 3%,
114
- transparent 50%
115
- );
116
- }
117
- }
118
- }
119
-
120
- &--feature-image {
121
- & .uq-hero__content {
122
- padding-top: 0;
123
-
124
- @media #{core.$screen-md-up} {
125
- padding-top: 6.5rem;
126
- }
127
- }
128
-
129
- & .hero__text {
130
- @media #{core.$screen-md-up} {
131
- width: 50%;
132
- }
133
- }
134
- }
135
-
136
- &--large {
137
- & .uq-hero__content {
138
- @media #{core.$screen-md-up} {
139
- padding-top: core.$space-uuuuul;
140
- padding-bottom: core.$space-uuuuul;
141
- }
142
- }
143
- }
144
- }