@deriv-web-design/ui 0.1.9 → 0.1.11
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/block-registry.json +18 -5
- package/components.manifest.json +7 -1
- package/dist/index.css +68 -32
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/block-registry.json
CHANGED
|
@@ -2836,7 +2836,8 @@
|
|
|
2836
2836
|
"deriv",
|
|
2837
2837
|
"dark",
|
|
2838
2838
|
"search",
|
|
2839
|
-
"help-centre"
|
|
2839
|
+
"help-centre",
|
|
2840
|
+
"navbar"
|
|
2840
2841
|
],
|
|
2841
2842
|
"sectionType": "header",
|
|
2842
2843
|
"global": false,
|
|
@@ -2851,7 +2852,8 @@
|
|
|
2851
2852
|
"secondaryButton",
|
|
2852
2853
|
"leftVisual",
|
|
2853
2854
|
"rightVisual",
|
|
2854
|
-
"search"
|
|
2855
|
+
"search",
|
|
2856
|
+
"underNavbar"
|
|
2855
2857
|
],
|
|
2856
2858
|
"variants": [
|
|
2857
2859
|
"visuals",
|
|
@@ -2878,7 +2880,8 @@
|
|
|
2878
2880
|
"secondaryButton": true,
|
|
2879
2881
|
"eyebrow": true,
|
|
2880
2882
|
"parallax": true,
|
|
2881
|
-
"search": true
|
|
2883
|
+
"search": true,
|
|
2884
|
+
"navbarClearance": true
|
|
2882
2885
|
},
|
|
2883
2886
|
"imageRoles": [
|
|
2884
2887
|
"left-visual",
|
|
@@ -2960,6 +2963,12 @@
|
|
|
2960
2963
|
"required": true,
|
|
2961
2964
|
"maxLength": 80
|
|
2962
2965
|
},
|
|
2966
|
+
"underNavbar": {
|
|
2967
|
+
"type": "boolean",
|
|
2968
|
+
"required": false,
|
|
2969
|
+
"description": "Set true when the fixed Navbar sits above this header (header is the first section on the page). Reserves top clearance equal to the navbar's footprint so the centred title does not slide under the fixed pill. Defaults to false.",
|
|
2970
|
+
"default": false
|
|
2971
|
+
},
|
|
2963
2972
|
"variant": {
|
|
2964
2973
|
"type": "string",
|
|
2965
2974
|
"required": true,
|
|
@@ -3409,7 +3418,7 @@
|
|
|
3409
3418
|
"name": "Hero",
|
|
3410
3419
|
"component": "Hero",
|
|
3411
3420
|
"category": "hero",
|
|
3412
|
-
"description": "Landing hero with title, description and CTA buttons. Three layouts: split (right-side image), centered (background image), showcase (product + floating images).",
|
|
3421
|
+
"description": "Landing hero with title, description and CTA buttons. Three layouts: split (right-side image + optional device mockup behind it), centered (background image), showcase (product + floating images).",
|
|
3413
3422
|
"purpose": "The primary hero section used to introduce a page with a strong title, supporting description, primary call-to-action, and optional secondary action. Exposed as a single `Hero` component with a required `variant` prop selecting one of three layouts: `split` (dark background, left-aligned text, right-side hero image), `centered` (full background image, center-aligned text), or `showcase` (dark background with a large product image and a smaller floating image below the buttons). This block is designed to be the first visible section of a landing page.",
|
|
3414
3423
|
"keywords": [
|
|
3415
3424
|
"hero",
|
|
@@ -3491,7 +3500,11 @@
|
|
|
3491
3500
|
"floatingImage": {
|
|
3492
3501
|
"type": "image",
|
|
3493
3502
|
"required": false,
|
|
3494
|
-
"
|
|
3503
|
+
"supportedVariants": [
|
|
3504
|
+
"split",
|
|
3505
|
+
"showcase"
|
|
3506
|
+
],
|
|
3507
|
+
"description": "Secondary foreground image. In Showcase it sits below productImage, cropped to 1:1. In Split it is a small layer anchored to the hero's lower inline-end, painted behind heroImage and hidden below 992px; portrait assets keep their natural aspect ratio. Accepts a ReactNode in code; page builders should pass an image URL string."
|
|
3495
3508
|
},
|
|
3496
3509
|
"heroImage": {
|
|
3497
3510
|
"type": "image",
|
package/components.manifest.json
CHANGED
|
@@ -2014,6 +2014,12 @@
|
|
|
2014
2014
|
"required": true,
|
|
2015
2015
|
"description": "Main heading"
|
|
2016
2016
|
},
|
|
2017
|
+
"underNavbar": {
|
|
2018
|
+
"type": "boolean",
|
|
2019
|
+
"required": false,
|
|
2020
|
+
"description": "Set to `true` when the fixed `Navbar` is rendered above this header (it is the first section on the page). Reserves top clearance equal to the navbar's footprint so the vertically-centred title never slides under the fixed pill. Defaults to `false` — leave it off when there is no navbar above the header.",
|
|
2021
|
+
"default": false
|
|
2022
|
+
},
|
|
2017
2023
|
"variant": {
|
|
2018
2024
|
"type": "HeaderVariant",
|
|
2019
2025
|
"required": true,
|
|
@@ -2284,7 +2290,7 @@
|
|
|
2284
2290
|
"floatingImage": {
|
|
2285
2291
|
"type": "ReactNode",
|
|
2286
2292
|
"required": false,
|
|
2287
|
-
"description": "
|
|
2293
|
+
"description": "Secondary foreground image. Accepts a ReactNode or image URL string. In the Showcase variant it sits below `productImage`, cropped to a 1:1 box. In the Split variant it is a small layer anchored to the hero's lower inline-end and painted behind `heroImage` so the subject overlaps it; it keeps its natural aspect ratio (no crop) and is hidden below 992px."
|
|
2288
2294
|
},
|
|
2289
2295
|
"heroImage": {
|
|
2290
2296
|
"type": "ReactNode",
|
package/dist/index.css
CHANGED
|
@@ -2834,7 +2834,10 @@
|
|
|
2834
2834
|
--hero-body-lh: var(--typography-body-md-line-height);
|
|
2835
2835
|
--hero-split-padding-top-mobile: var(--spacing-80);
|
|
2836
2836
|
--hero-split-padding-top-tablet: var(--spacing-96);
|
|
2837
|
-
--hero-split-
|
|
2837
|
+
--hero-split-min-height: 35.25rem;
|
|
2838
|
+
--hero-split-floating-width: 16%;
|
|
2839
|
+
--hero-split-floating-inset-inline-end: 28%;
|
|
2840
|
+
--hero-split-floating-inset-bottom: 17%;
|
|
2838
2841
|
--hero-shrink-radius: 3.5rem;
|
|
2839
2842
|
--hero-padding-top-mobile: var(--spacing-80);
|
|
2840
2843
|
--hero-padding-top-tablet: var(--spacing-96);
|
|
@@ -2909,6 +2912,7 @@
|
|
|
2909
2912
|
gap: var(--spacing-24);
|
|
2910
2913
|
}
|
|
2911
2914
|
.hero--split {
|
|
2915
|
+
background-position: left center;
|
|
2912
2916
|
animation: hero-split-shrink linear both;
|
|
2913
2917
|
animation-timeline: view();
|
|
2914
2918
|
animation-range: exit 0% exit 40%;
|
|
@@ -2978,9 +2982,21 @@
|
|
|
2978
2982
|
height: 100%;
|
|
2979
2983
|
display: block;
|
|
2980
2984
|
}
|
|
2985
|
+
.hero--split .hero__floating-image {
|
|
2986
|
+
display: none;
|
|
2987
|
+
pointer-events: none;
|
|
2988
|
+
}
|
|
2989
|
+
.hero--split .hero__text {
|
|
2990
|
+
gap: 0;
|
|
2991
|
+
}
|
|
2981
2992
|
.hero--split .hero__subtitle {
|
|
2982
|
-
font-size: var(--typography-
|
|
2983
|
-
line-height: var(--typography-
|
|
2993
|
+
font-size: var(--typography-h5-font-size);
|
|
2994
|
+
line-height: var(--typography-h5-line-height);
|
|
2995
|
+
font-weight: var(--typography-h5-font-weight);
|
|
2996
|
+
}
|
|
2997
|
+
.hero--split .hero__description {
|
|
2998
|
+
margin-top: var(--spacing-16);
|
|
2999
|
+
opacity: 1;
|
|
2984
3000
|
}
|
|
2985
3001
|
.hero--split .hero__buttons {
|
|
2986
3002
|
align-items: stretch;
|
|
@@ -3206,51 +3222,59 @@
|
|
|
3206
3222
|
}
|
|
3207
3223
|
.hero--split .hero__inner {
|
|
3208
3224
|
max-width: var(--content-width-1280);
|
|
3209
|
-
padding-top:
|
|
3210
|
-
padding-bottom:
|
|
3225
|
+
padding-top: 0;
|
|
3226
|
+
padding-bottom: 0;
|
|
3211
3227
|
padding-left: var(--spacing-32);
|
|
3212
3228
|
padding-right: var(--spacing-32);
|
|
3213
3229
|
height: 100vh;
|
|
3230
|
+
min-height: var(--hero-split-min-height);
|
|
3214
3231
|
justify-content: center;
|
|
3215
3232
|
align-items: flex-start;
|
|
3216
3233
|
}
|
|
3217
3234
|
.hero--split .hero__content {
|
|
3218
3235
|
flex-direction: column;
|
|
3219
|
-
gap: var(--spacing-
|
|
3236
|
+
gap: var(--spacing-24);
|
|
3220
3237
|
max-width: 600px;
|
|
3221
3238
|
}
|
|
3222
3239
|
.hero--split .hero__left {
|
|
3223
3240
|
width: 100%;
|
|
3224
3241
|
}
|
|
3225
3242
|
.hero--split .hero__body {
|
|
3226
|
-
gap: var(--spacing-
|
|
3227
|
-
}
|
|
3228
|
-
.hero--split .hero__subtitle {
|
|
3229
|
-
line-height: var(--typography-h5-line-height);
|
|
3243
|
+
gap: var(--spacing-24);
|
|
3230
3244
|
}
|
|
3231
3245
|
.hero--split .hero__image-slot {
|
|
3232
3246
|
position: absolute;
|
|
3233
|
-
|
|
3234
|
-
right: auto;
|
|
3235
|
-
left: 50%;
|
|
3247
|
+
inset: auto -4% -14% auto;
|
|
3236
3248
|
transform: none;
|
|
3237
|
-
z-index:
|
|
3249
|
+
z-index: 1;
|
|
3238
3250
|
width: 50%;
|
|
3239
|
-
height:
|
|
3240
|
-
display:
|
|
3241
|
-
align-items: center;
|
|
3242
|
-
justify-content: center;
|
|
3251
|
+
height: 100%;
|
|
3252
|
+
display: block;
|
|
3243
3253
|
overflow: visible;
|
|
3244
3254
|
pointer-events: none;
|
|
3245
3255
|
max-width: none;
|
|
3246
3256
|
}
|
|
3247
3257
|
.hero--split .hero__image-slot img {
|
|
3248
3258
|
height: 100%;
|
|
3249
|
-
width:
|
|
3259
|
+
width: 100%;
|
|
3250
3260
|
max-height: none;
|
|
3251
3261
|
max-width: none;
|
|
3252
3262
|
object-fit: contain;
|
|
3253
|
-
object-position:
|
|
3263
|
+
object-position: 40% 100%;
|
|
3264
|
+
}
|
|
3265
|
+
.hero--split .hero__floating-image {
|
|
3266
|
+
display: block;
|
|
3267
|
+
position: absolute;
|
|
3268
|
+
width: var(--hero-split-floating-width);
|
|
3269
|
+
inset-inline-end: var(--hero-split-floating-inset-inline-end);
|
|
3270
|
+
bottom: var(--hero-split-floating-inset-bottom);
|
|
3271
|
+
z-index: 1;
|
|
3272
|
+
}
|
|
3273
|
+
.hero--split .hero__floating-image img,
|
|
3274
|
+
.hero--split .hero__floating-image > *:not(img) {
|
|
3275
|
+
display: block;
|
|
3276
|
+
width: 100%;
|
|
3277
|
+
height: auto;
|
|
3254
3278
|
}
|
|
3255
3279
|
.hero--split .hero__buttons {
|
|
3256
3280
|
flex-direction: row;
|
|
@@ -3261,10 +3285,14 @@
|
|
|
3261
3285
|
.hero--split .hero__overlay {
|
|
3262
3286
|
background:
|
|
3263
3287
|
linear-gradient(
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3288
|
+
180deg,
|
|
3289
|
+
rgba(0, 0, 0, 0.4) 0%,
|
|
3290
|
+
rgba(255, 255, 255, 0) 12%),
|
|
3291
|
+
linear-gradient(
|
|
3292
|
+
84.29deg,
|
|
3293
|
+
rgba(0, 0, 0, 0.2) 22%,
|
|
3294
|
+
rgba(143, 143, 143, 0.04) 84%,
|
|
3295
|
+
rgba(0, 0, 0, 0) 100%);
|
|
3268
3296
|
}
|
|
3269
3297
|
.hero--centered .hero__inner {
|
|
3270
3298
|
padding-top: var(--hero-padding-top-desktop);
|
|
@@ -3318,6 +3346,8 @@
|
|
|
3318
3346
|
--header-text-light: var(--color-slate-50);
|
|
3319
3347
|
--header-dark-min-height: 420px;
|
|
3320
3348
|
--header-dark-min-height-desktop: 460px;
|
|
3349
|
+
--header-navbar-clearance: 0px;
|
|
3350
|
+
--header-light-min-height: 540px;
|
|
3321
3351
|
--header-subtitle-size: var(--typography-body-md-font-size);
|
|
3322
3352
|
--header-subtitle-lh: var(--typography-body-md-line-height);
|
|
3323
3353
|
--header-subtitle-weight: var(--font-weight-semi-bold);
|
|
@@ -3333,10 +3363,13 @@
|
|
|
3333
3363
|
box-sizing: border-box;
|
|
3334
3364
|
overflow: hidden;
|
|
3335
3365
|
background-color: var(--header-light-bg);
|
|
3336
|
-
min-height:
|
|
3366
|
+
min-height: calc(var(--header-light-min-height) + var(--header-navbar-clearance));
|
|
3337
3367
|
display: flex;
|
|
3338
3368
|
align-items: center;
|
|
3339
3369
|
}
|
|
3370
|
+
.header--under-navbar {
|
|
3371
|
+
--header-navbar-clearance: var(--navbar-height, 4rem);
|
|
3372
|
+
}
|
|
3340
3373
|
.header__grid {
|
|
3341
3374
|
position: absolute;
|
|
3342
3375
|
inset: 0;
|
|
@@ -3372,12 +3405,12 @@
|
|
|
3372
3405
|
max-width: var(--content-width-1280);
|
|
3373
3406
|
margin: 0 auto;
|
|
3374
3407
|
box-sizing: border-box;
|
|
3375
|
-
padding: var(--spacing-24) var(--spacing-16);
|
|
3408
|
+
padding: calc(var(--spacing-24) + var(--header-navbar-clearance)) var(--spacing-16) var(--spacing-24);
|
|
3376
3409
|
display: flex;
|
|
3377
3410
|
flex-direction: column;
|
|
3378
3411
|
align-items: flex-start;
|
|
3379
3412
|
justify-content: center;
|
|
3380
|
-
min-height:
|
|
3413
|
+
min-height: calc(var(--header-light-min-height) + var(--header-navbar-clearance));
|
|
3381
3414
|
}
|
|
3382
3415
|
.header__content {
|
|
3383
3416
|
display: flex;
|
|
@@ -3463,11 +3496,11 @@
|
|
|
3463
3496
|
.header--dark,
|
|
3464
3497
|
.header--dark-search {
|
|
3465
3498
|
background-color: var(--header-dark-bg);
|
|
3466
|
-
min-height: var(--header-dark-min-height);
|
|
3499
|
+
min-height: calc(var(--header-dark-min-height) + var(--header-navbar-clearance));
|
|
3467
3500
|
}
|
|
3468
3501
|
.header--dark .header__inner,
|
|
3469
3502
|
.header--dark-search .header__inner {
|
|
3470
|
-
min-height: var(--header-dark-min-height);
|
|
3503
|
+
min-height: calc(var(--header-dark-min-height) + var(--header-navbar-clearance));
|
|
3471
3504
|
}
|
|
3472
3505
|
.header--dark .header__grid,
|
|
3473
3506
|
.header--dark-search .header__grid {
|
|
@@ -3521,7 +3554,7 @@
|
|
|
3521
3554
|
}
|
|
3522
3555
|
@media (min-width: 768px) {
|
|
3523
3556
|
.header__inner {
|
|
3524
|
-
padding: var(--spacing-40) var(--spacing-24);
|
|
3557
|
+
padding: calc(var(--spacing-40) + var(--header-navbar-clearance)) var(--spacing-24) var(--spacing-40);
|
|
3525
3558
|
align-items: center;
|
|
3526
3559
|
}
|
|
3527
3560
|
.header__content {
|
|
@@ -3539,8 +3572,11 @@
|
|
|
3539
3572
|
}
|
|
3540
3573
|
}
|
|
3541
3574
|
@media (min-width: 992px) {
|
|
3575
|
+
.header--under-navbar {
|
|
3576
|
+
--header-navbar-clearance: calc(var(--navbar-height, 4rem) + var(--spacing-16) * 2);
|
|
3577
|
+
}
|
|
3542
3578
|
.header__inner {
|
|
3543
|
-
padding: var(--spacing-48) var(--spacing-32);
|
|
3579
|
+
padding: calc(var(--spacing-48) + var(--header-navbar-clearance)) var(--spacing-32) var(--spacing-48);
|
|
3544
3580
|
position: relative;
|
|
3545
3581
|
}
|
|
3546
3582
|
.header__content {
|
|
@@ -3551,7 +3587,7 @@
|
|
|
3551
3587
|
.header--dark-search,
|
|
3552
3588
|
.header--dark .header__inner,
|
|
3553
3589
|
.header--dark-search .header__inner {
|
|
3554
|
-
min-height: var(--header-dark-min-height-desktop);
|
|
3590
|
+
min-height: calc(var(--header-dark-min-height-desktop) + var(--header-navbar-clearance));
|
|
3555
3591
|
}
|
|
3556
3592
|
.header__buttons {
|
|
3557
3593
|
flex-direction: row;
|