@phillips/seldon 1.260.0 → 1.261.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/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/components/Banner/Banner.cjs +1 -0
- package/dist/components/Banner/Banner.d.ts +27 -0
- package/dist/components/Banner/Banner.js +70 -0
- package/dist/components/Banner/Banner.stories.d.ts +65 -0
- package/dist/components/Banner/Banner.test.d.ts +1 -0
- package/dist/components/Banner/index.d.ts +2 -0
- package/dist/components/Banner/types.cjs +1 -0
- package/dist/components/Banner/types.d.ts +8 -0
- package/dist/components/Banner/types.js +5 -0
- package/dist/components/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +20 -19
- package/dist/components/Input/utils.cjs +1 -1
- package/dist/components/Input/utils.js +3 -2
- package/dist/components/Navigation/Navigation.cjs +1 -1
- package/dist/components/Navigation/Navigation.js +30 -29
- package/dist/components/Navigation/NavigationItemWithSubmenu/NavigationItemWithSubmenu.cjs +1 -1
- package/dist/components/Navigation/NavigationItemWithSubmenu/NavigationItemWithSubmenu.js +28 -27
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +247 -240
- package/dist/node_modules/ics/dist/schema/index.cjs +1 -1
- package/dist/node_modules/ics/dist/schema/index.js +1 -1
- package/dist/node_modules/ics/dist/utils/index.cjs +1 -1
- package/dist/node_modules/ics/dist/utils/index.js +1 -1
- package/dist/patterns/AccountPageHeader/AccountPageHeader.cjs +1 -1
- package/dist/patterns/AccountPageHeader/AccountPageHeader.js +27 -26
- package/dist/patterns/FiltersInline/SubFilterDropdown.cjs +1 -1
- package/dist/patterns/FiltersInline/SubFilterDropdown.js +38 -37
- package/dist/patterns/LanguageSelector/LanguageSelector.cjs +1 -1
- package/dist/patterns/LanguageSelector/LanguageSelector.js +31 -30
- package/dist/patterns/SaleCard/SaleCard.cjs +1 -1
- package/dist/patterns/SaleCard/SaleCard.js +19 -18
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.cjs +1 -1
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.js +70 -66
- package/dist/providers/SeldonProvider/utils.d.ts +1 -1
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/components/Banner/_banner.scss +185 -0
- package/dist/scss/patterns/SaleHeaderBanner/_saleHeaderBanner.scss +10 -16
- package/dist/site-furniture/Header/Header.cjs +1 -1
- package/dist/site-furniture/Header/Header.js +15 -14
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.d.ts +7 -0
- package/dist/utils/constants.js +7 -4
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,79 +1,83 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { AuctionStatus as
|
|
2
|
+
import { forwardRef as R } from "react";
|
|
3
|
+
import { getCommonProps as D } from "../../utils/index.js";
|
|
4
|
+
import F from "../../_virtual/index.js";
|
|
5
|
+
import p from "../../components/Countdown/Countdown.js";
|
|
6
|
+
import O from "../../components/SeldonImage/SeldonImage.js";
|
|
7
|
+
import { AuctionStatus as V } from "../../types/commonTypes.js";
|
|
8
8
|
import { TextVariants as r } from "../../components/Text/types.js";
|
|
9
|
-
import
|
|
9
|
+
import t from "../../components/Text/Text.js";
|
|
10
10
|
import q from "../../components/PageContentWrapper/PageContentWrapper.js";
|
|
11
11
|
import { SSRMediaQuery as f } from "../../providers/SeldonProvider/utils.js";
|
|
12
|
-
|
|
12
|
+
import n from "../../components/Banner/Banner.js";
|
|
13
|
+
import { Breakpoints as u } from "../../utils/constants.js";
|
|
14
|
+
import { BannerVariants as I, BannerMediaSize as L } from "../../components/Banner/types.js";
|
|
15
|
+
const Q = R(
|
|
13
16
|
({
|
|
14
|
-
auctionEndTime:
|
|
15
|
-
auctionTitle:
|
|
16
|
-
badgeText:
|
|
17
|
-
imageSrcUrl:
|
|
18
|
-
imageSrcSet:
|
|
19
|
-
imageSizes:
|
|
20
|
-
imageLoading:
|
|
21
|
-
imageFetchPriority:
|
|
17
|
+
auctionEndTime: l,
|
|
18
|
+
auctionTitle: o,
|
|
19
|
+
badgeText: s,
|
|
20
|
+
imageSrcUrl: v,
|
|
21
|
+
imageSrcSet: N,
|
|
22
|
+
imageSizes: g,
|
|
23
|
+
imageLoading: S,
|
|
24
|
+
imageFetchPriority: $,
|
|
22
25
|
location: b,
|
|
23
|
-
countdownTimerLabel:
|
|
24
|
-
countdownFormatDuration:
|
|
25
|
-
auctionState:
|
|
26
|
-
occurrenceInformation:
|
|
27
|
-
onClick:
|
|
28
|
-
children:
|
|
29
|
-
className:
|
|
26
|
+
countdownTimerLabel: B,
|
|
27
|
+
countdownFormatDuration: M,
|
|
28
|
+
auctionState: w,
|
|
29
|
+
occurrenceInformation: C,
|
|
30
|
+
onClick: T,
|
|
31
|
+
children: k,
|
|
32
|
+
className: x,
|
|
30
33
|
footerElement: P,
|
|
31
|
-
headerLabel:
|
|
32
|
-
showTimer:
|
|
33
|
-
getCurrentDateTime:
|
|
34
|
-
...
|
|
35
|
-
},
|
|
36
|
-
const { className: a, ...
|
|
37
|
-
endDateTime:
|
|
38
|
-
label:
|
|
39
|
-
formatDurationStr:
|
|
40
|
-
getCurrentDateTime:
|
|
34
|
+
headerLabel: y,
|
|
35
|
+
showTimer: m,
|
|
36
|
+
getCurrentDateTime: j,
|
|
37
|
+
...c
|
|
38
|
+
}, z) => {
|
|
39
|
+
const { className: a, ...A } = D(c, "SaleHeaderBanner"), d = w === V.live, _ = {
|
|
40
|
+
endDateTime: l,
|
|
41
|
+
label: B,
|
|
42
|
+
formatDurationStr: M,
|
|
43
|
+
getCurrentDateTime: j
|
|
41
44
|
};
|
|
42
|
-
return /* @__PURE__ */ i("div", { ...
|
|
43
|
-
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
className: `${a}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */ e(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
45
|
+
return /* @__PURE__ */ i("div", { ...A, className: F(a, x), ...c, ref: z, children: [
|
|
46
|
+
d && l && m ? /* @__PURE__ */ e(f.Media, { lessThan: u.md, children: /* @__PURE__ */ e("div", { className: `${a}__stack__countdown`, children: /* @__PURE__ */ e(p, { ..._, showBottomBorder: !1, centerAlign: !0 }) }) }) : null,
|
|
47
|
+
/* @__PURE__ */ i(n, { variant: I.top, children: [
|
|
48
|
+
/* @__PURE__ */ e(n.Content, { children: /* @__PURE__ */ e(q, { children: /* @__PURE__ */ i("div", { className: `${a}__stack`, children: [
|
|
49
|
+
d && l && m ? /* @__PURE__ */ e(f.Media, { greaterThanOrEqual: u.md, children: /* @__PURE__ */ e("div", { className: `${a}__stack__countdown`, children: /* @__PURE__ */ e(p, { ..._, centerAlign: !0 }) }) }) : null,
|
|
50
|
+
/* @__PURE__ */ e(n.Eyebrow, { variant: r.labelMedium, className: `${a}__header-label`, children: y }),
|
|
51
|
+
/* @__PURE__ */ e(n.Title, { variant: r.headingLarge, element: "h1", className: `${a}__title`, children: o }),
|
|
52
|
+
s && /* @__PURE__ */ e(t, { variant: r.badge, className: `${a}__badge`, children: s }),
|
|
53
|
+
/* @__PURE__ */ e(t, { variant: r.labelMedium, className: `${a}__location`, children: b }),
|
|
54
|
+
/* @__PURE__ */ i("div", { className: `${a}__occurrence-details`, children: [
|
|
55
|
+
C.map(({ date: h, occurrenceLabel: H }) => /* @__PURE__ */ i("div", { className: `${a}__occurrence-details-text`, children: [
|
|
56
|
+
/* @__PURE__ */ e(t, { variant: r.labelMedium, children: H }),
|
|
57
|
+
/* @__PURE__ */ e(t, { variant: r.labelMedium, className: `${a}__date`, children: h })
|
|
58
|
+
] }, String(h))),
|
|
59
|
+
k
|
|
60
|
+
] }),
|
|
61
|
+
P
|
|
62
|
+
] }) }) }),
|
|
63
|
+
/* @__PURE__ */ e(n.Media, { size: L.half, className: `${a}__image`, children: /* @__PURE__ */ e(
|
|
64
|
+
O,
|
|
65
|
+
{
|
|
66
|
+
aspectRatio: "16/9",
|
|
67
|
+
src: v,
|
|
68
|
+
alt: String(o),
|
|
69
|
+
objectFit: "cover",
|
|
70
|
+
srcSet: N,
|
|
71
|
+
sizes: g,
|
|
72
|
+
loading: S,
|
|
73
|
+
fetchPriority: $
|
|
74
|
+
}
|
|
75
|
+
) })
|
|
76
|
+
] })
|
|
73
77
|
] });
|
|
74
78
|
}
|
|
75
79
|
);
|
|
76
|
-
|
|
80
|
+
Q.displayName = "SaleHeaderBanner";
|
|
77
81
|
export {
|
|
78
|
-
|
|
82
|
+
Q as default
|
|
79
83
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Used to hide or show components based on the current breakpoint in a SSR friendly way
|
|
3
3
|
*/
|
|
4
|
-
export declare const SSRMediaQuery: import('@artsy/fresnel/dist/Media').CreateMediaResults<"
|
|
4
|
+
export declare const SSRMediaQuery: import('@artsy/fresnel/dist/Media').CreateMediaResults<"snw-mobile" | "xsm" | "sm" | "md" | "lg", never>;
|
|
5
5
|
export declare const ssrMediaQueryStyle: string;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
@use '../../allPartials' as *;
|
|
2
|
+
|
|
3
|
+
.#{$px}-banner {
|
|
4
|
+
min-width: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
|
|
7
|
+
&__inner {
|
|
8
|
+
align-items: center;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: 16px;
|
|
12
|
+
|
|
13
|
+
// Stacked: always show media above copy; at snw-mobile+ DOM order controls left/right in the row.
|
|
14
|
+
> .#{$px}-banner__media {
|
|
15
|
+
order: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
> .#{$px}-banner__column-gap {
|
|
19
|
+
order: 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
> .#{$px}-banner__body {
|
|
23
|
+
order: 2;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include media($breakpoint-snw-mobile) {
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
|
|
29
|
+
> .#{$px}-banner__media,
|
|
30
|
+
> .#{$px}-banner__column-gap,
|
|
31
|
+
> .#{$px}-banner__body {
|
|
32
|
+
order: unset;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__media {
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
position: relative;
|
|
40
|
+
width: 100%;
|
|
41
|
+
|
|
42
|
+
@include media($breakpoint-snw-mobile) {
|
|
43
|
+
width: auto;
|
|
44
|
+
|
|
45
|
+
&--1-3 {
|
|
46
|
+
flex-basis: 33.333%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&--1-2 {
|
|
50
|
+
flex-basis: 50%;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&__column-gap {
|
|
56
|
+
align-self: stretch;
|
|
57
|
+
background: $grey-50;
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
margin: 0 $spacing-xsm;
|
|
60
|
+
width: 1px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__body {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: $spacing-xsm;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
width: 100%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&__description {
|
|
72
|
+
-webkit-box-orient: vertical;
|
|
73
|
+
color: $text-supporting;
|
|
74
|
+
display: -webkit-box;
|
|
75
|
+
-webkit-line-clamp: 3;
|
|
76
|
+
line-clamp: 3;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
|
|
79
|
+
@include media($breakpoint-snw-mobile) {
|
|
80
|
+
-webkit-line-clamp: 2;
|
|
81
|
+
line-clamp: 2;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&__cta {
|
|
86
|
+
text-decoration: underline;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&__media-frame {
|
|
90
|
+
aspect-ratio: 16 / 9;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__media-img {
|
|
96
|
+
display: block;
|
|
97
|
+
height: 100%;
|
|
98
|
+
object-fit: cover;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--inline {
|
|
103
|
+
border-bottom: 1px solid $grey-50;
|
|
104
|
+
border-top: 1px solid $grey-50;
|
|
105
|
+
padding: 16px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&--top {
|
|
109
|
+
// Top-of-page banners: uses default `&__inner` gap ($spacing-sm). Full-width Fresnel slices (e.g. countdown).
|
|
110
|
+
.#{$px}-banner__body .fresnel-container {
|
|
111
|
+
width: 100%;
|
|
112
|
+
}
|
|
113
|
+
.#{$px}-banner__body {
|
|
114
|
+
justify-content: center;
|
|
115
|
+
padding-left: 0;
|
|
116
|
+
|
|
117
|
+
@include media($breakpoint-md) {
|
|
118
|
+
padding: $spacing-md 0;
|
|
119
|
+
padding-left: $spacing-lg;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.#{$px}-banner__inner {
|
|
124
|
+
align-items: stretch;
|
|
125
|
+
column-gap: 0;
|
|
126
|
+
|
|
127
|
+
@include media($breakpoint-snw-mobile) {
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
|
|
130
|
+
> .#{$px}-banner__media {
|
|
131
|
+
order: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
> .#{$px}-banner__column-gap {
|
|
135
|
+
order: 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
> .#{$px}-banner__body {
|
|
139
|
+
order: 2;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@include media($breakpoint-md) {
|
|
144
|
+
flex-direction: row;
|
|
145
|
+
|
|
146
|
+
> .#{$px}-banner__media,
|
|
147
|
+
> .#{$px}-banner__column-gap,
|
|
148
|
+
> .#{$px}-banner__body {
|
|
149
|
+
order: unset;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.#{$px}-banner__media {
|
|
155
|
+
@include media($breakpoint-snw-mobile) {
|
|
156
|
+
width: 100%;
|
|
157
|
+
|
|
158
|
+
&--1-3,
|
|
159
|
+
&--1-2 {
|
|
160
|
+
flex-basis: unset;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@include media($breakpoint-md) {
|
|
165
|
+
width: auto;
|
|
166
|
+
|
|
167
|
+
&--1-3 {
|
|
168
|
+
flex-basis: 33.333%;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&--1-2 {
|
|
172
|
+
flex-basis: 50%;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Row layout: page margins inset copy from the media seam; remove inline-start padding
|
|
178
|
+
// so the stack aligns with the image edge (SaleHeaderBanner and similar).
|
|
179
|
+
@include media($breakpoint-md) {
|
|
180
|
+
.#{$px}-banner__body > .#{$px}-page-content-wrapper {
|
|
181
|
+
padding-inline-start: 0;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
.#{$px}-sale-header-banner {
|
|
4
4
|
border-bottom: 1px solid $light-gray;
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
5
|
margin-bottom: $spacing-md;
|
|
8
6
|
|
|
7
|
+
@include media($breakpoint-md, $type: 'max') {
|
|
8
|
+
.#{$px}-banner__inner {
|
|
9
|
+
gap: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__stack {
|
|
13
|
+
padding: $spacing-md 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
&__header-label {
|
|
10
18
|
margin-bottom: $spacing-xsm;
|
|
11
19
|
}
|
|
@@ -16,30 +24,16 @@
|
|
|
16
24
|
}
|
|
17
25
|
}
|
|
18
26
|
|
|
19
|
-
.fresnel-container {
|
|
20
|
-
width: 100%;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
27
|
.#{$px}-countdown {
|
|
24
28
|
padding-top: var(--spacing-sm);
|
|
25
29
|
}
|
|
26
30
|
|
|
27
|
-
@include media($size-md, $type: 'min') {
|
|
28
|
-
flex-direction: row-reverse;
|
|
29
|
-
|
|
30
|
-
&__image,
|
|
31
|
-
&__stack-wrapper {
|
|
32
|
-
flex: 0 50%;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
31
|
&__stack {
|
|
37
32
|
align-items: start;
|
|
38
33
|
display: flex;
|
|
39
34
|
flex-direction: column;
|
|
40
35
|
height: 100%;
|
|
41
36
|
justify-content: center;
|
|
42
|
-
padding: $spacing-md 0;
|
|
43
37
|
|
|
44
38
|
&__countdown {
|
|
45
39
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("../../_virtual/index.cjs"),t=require("react"),U=require("../../components/Icon/Icon.cjs"),E=require("../../components/Navigation/Navigation.cjs"),y=require("../../patterns/LanguageSelector/LanguageSelector.cjs"),j=require("../../patterns/UserManagement/UserManagement.cjs"),D=require("../../providers/SeldonProvider/utils.cjs"),n=require("../../utils/index.cjs"),F=require("./hooks.cjs"),G=require("./utils.cjs"),C=t.createContext(G.defaultHeaderContext),S=t.forwardRef(({logo:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("../../_virtual/index.cjs"),t=require("react"),U=require("../../components/Icon/Icon.cjs"),E=require("../../components/Navigation/Navigation.cjs"),y=require("../../patterns/LanguageSelector/LanguageSelector.cjs"),j=require("../../patterns/UserManagement/UserManagement.cjs"),D=require("../../providers/SeldonProvider/utils.cjs"),n=require("../../utils/index.cjs"),F=require("./hooks.cjs"),G=require("./utils.cjs"),J=require("../../utils/constants.cjs"),C=t.createContext(G.defaultHeaderContext),S=t.forwardRef(({logo:c=r.jsx(U.default,{icon:"PhillipsLogo"}),logoHref:$="/",className:H,children:i,toggleOpenText:M="Open Menu",toggleCloseText:q="Close Menu",logoText:O="Home Page",disabled:u,bannerRef:l,skipToContentId:h="main",skipLinkLabel:N="Skip to main content",...w},a)=>{const g=n.findChildrenOfType(i,j.default),k=t.isValidElement(g?.[0])?t.cloneElement(g[0],{disabled:u}):"",m=n.findChildrenOfType(i,y.default),p=t.isValidElement(m?.[0])?t.cloneElement(m[0],{disabled:u}):"",[f,T]=t.useState(!1),P=n.findChildrenOfType(i,E.default),R=n.findChildrenExcludingTypes(i,[E.default,j.default,y.default]),{closeMenu:z,handleMenuToggle:I,isMenuOpen:d,toggleText:V}=F.useMobileMenu({toggleOpenText:M,toggleCloseText:q}),[A,B]=t.useState(null),[x,v]=t.useState(l?.current?l.current.clientHeight:0),b=t.useRef(null);t.useEffect(()=>{const e=l?.current;if(!e)return;v(e.clientHeight);const s=new window.ResizeObserver(()=>{v(e.clientHeight)});return s.observe(e),()=>{s.disconnect()}},[l,x]),t.useEffect(()=>{const e=b.current;if(!e)return;const s=()=>{const Q=e.offsetHeight;document.documentElement.style.setProperty("--header-height",`${Q}px`)};s();const _=new window.ResizeObserver(s);return _.observe(e),()=>{_.disconnect()}},[]);const L=t.useCallback(e=>{b.current=e,typeof a=="function"?a(e):a&&(a.current=e)},[a]);return r.jsxs("header",{...w,className:o.default(`${n.px}-header`,H),ref:L,style:{"--banner-height":`${x}px`},children:[h&&r.jsx("a",{href:`#${h}`,className:`${n.px}-header__skip-link`,"data-testid":"skip-to-content",children:N}),r.jsxs("div",{className:`${n.px}-header__top-row`,children:[r.jsx(D.SSRMediaQuery.Media,{greaterThanOrEqual:J.Breakpoints.md,children:p}),r.jsxs("button",{"aria-label":V,"data-testid":"mobile-menu-toggle",type:"button",onClick:I,className:o.default(`${n.px}-header__toggle-btn`,{[`${n.px}-header__toggle-btn--open`]:d}),children:[r.jsx("span",{})," "]}),r.jsx("a",{href:$,"aria-label":O,"data-testid":"header-logo",className:`${n.px}-header__logo`,children:typeof c=="object"?c:r.jsx("img",{alt:"Phillips","data-testid":"header-logo-img",src:c})}),k]}),r.jsx("div",{className:o.default(`${n.px}-header__nav`,{[`${n.px}-header__nav--closed`]:!d}),children:r.jsxs(C.Provider,{value:{activeSubmenuId:A,setActiveSubmenuId:B,isMenuOpen:d,isSearchExpanded:f,setIsSearchExpanded:T,closeMenu:z},children:[t.Children.map(P,e=>t.isValidElement(e)?t.cloneElement(e,{children:[...t.Children.toArray(e.props.children),p]}):e),R]})}),r.jsx("div",{className:o.default(`${n.px}-header__overlay`,{[`${n.px}-header__overlay--active`]:f})})]})});S.displayName="Header";exports.HeaderContext=C;exports.default=S;
|
|
@@ -9,7 +9,8 @@ import { SSRMediaQuery as K } from "../../providers/SeldonProvider/utils.js";
|
|
|
9
9
|
import { findChildrenOfType as u, findChildrenExcludingTypes as W, px as n } from "../../utils/index.js";
|
|
10
10
|
import { useMobileMenu as X } from "./hooks.js";
|
|
11
11
|
import { defaultHeaderContext as Y } from "./utils.js";
|
|
12
|
-
|
|
12
|
+
import { Breakpoints as Z } from "../../utils/constants.js";
|
|
13
|
+
const ee = F(Y), te = G(
|
|
13
14
|
({
|
|
14
15
|
logo: d = /* @__PURE__ */ r(J, { icon: "PhillipsLogo" }),
|
|
15
16
|
logoHref: N = "/",
|
|
@@ -18,16 +19,16 @@ const Z = F(Y), ee = G(
|
|
|
18
19
|
toggleOpenText: O = "Open Menu",
|
|
19
20
|
toggleCloseText: k = "Close Menu",
|
|
20
21
|
logoText: P = "Home Page",
|
|
21
|
-
disabled:
|
|
22
|
+
disabled: p,
|
|
22
23
|
bannerRef: s,
|
|
23
|
-
skipToContentId:
|
|
24
|
+
skipToContentId: g = "main",
|
|
24
25
|
skipLinkLabel: R = "Skip to main content",
|
|
25
26
|
...z
|
|
26
27
|
}, a) => {
|
|
27
|
-
const f = u(i, S), T = t.isValidElement(f?.[0]) ? t.cloneElement(f[0], { disabled:
|
|
28
|
+
const f = u(i, S), T = t.isValidElement(f?.[0]) ? t.cloneElement(f[0], { disabled: p }) : "", v = u(i, M), _ = t.isValidElement(v?.[0]) ? t.cloneElement(v[0], { disabled: p }) : "", [b, j] = h(!1), I = u(i, C), V = W(i, [C, S, M]), { closeMenu: A, handleMenuToggle: B, isMenuOpen: m, toggleText: L } = X({
|
|
28
29
|
toggleOpenText: O,
|
|
29
30
|
toggleCloseText: k
|
|
30
|
-
}), [
|
|
31
|
+
}), [q, Q] = h(null), [E, x] = h(s?.current ? s.current.clientHeight : 0), y = t.useRef(null);
|
|
31
32
|
$(() => {
|
|
32
33
|
const e = s?.current;
|
|
33
34
|
if (!e) return;
|
|
@@ -65,16 +66,16 @@ const Z = F(Y), ee = G(
|
|
|
65
66
|
ref: U,
|
|
66
67
|
style: { "--banner-height": `${E}px` },
|
|
67
68
|
children: [
|
|
68
|
-
|
|
69
|
+
g && /* @__PURE__ */ r("a", { href: `#${g}`, className: `${n}-header__skip-link`, "data-testid": "skip-to-content", children: R }),
|
|
69
70
|
/* @__PURE__ */ l("div", { className: `${n}-header__top-row`, children: [
|
|
70
|
-
/* @__PURE__ */ r(K.Media, { greaterThanOrEqual:
|
|
71
|
+
/* @__PURE__ */ r(K.Media, { greaterThanOrEqual: Z.md, children: _ }),
|
|
71
72
|
/* @__PURE__ */ l(
|
|
72
73
|
"button",
|
|
73
74
|
{
|
|
74
|
-
"aria-label":
|
|
75
|
+
"aria-label": L,
|
|
75
76
|
"data-testid": "mobile-menu-toggle",
|
|
76
77
|
type: "button",
|
|
77
|
-
onClick:
|
|
78
|
+
onClick: B,
|
|
78
79
|
className: c(`${n}-header__toggle-btn`, {
|
|
79
80
|
[`${n}-header__toggle-btn--open`]: m
|
|
80
81
|
}),
|
|
@@ -88,10 +89,10 @@ const Z = F(Y), ee = G(
|
|
|
88
89
|
T
|
|
89
90
|
] }),
|
|
90
91
|
/* @__PURE__ */ r("div", { className: c(`${n}-header__nav`, { [`${n}-header__nav--closed`]: !m }), children: /* @__PURE__ */ l(
|
|
91
|
-
|
|
92
|
+
ee.Provider,
|
|
92
93
|
{
|
|
93
94
|
value: {
|
|
94
|
-
activeSubmenuId:
|
|
95
|
+
activeSubmenuId: q,
|
|
95
96
|
setActiveSubmenuId: Q,
|
|
96
97
|
isMenuOpen: m,
|
|
97
98
|
isSearchExpanded: b,
|
|
@@ -125,8 +126,8 @@ const Z = F(Y), ee = G(
|
|
|
125
126
|
);
|
|
126
127
|
}
|
|
127
128
|
);
|
|
128
|
-
|
|
129
|
+
te.displayName = "Header";
|
|
129
130
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
ee as HeaderContext,
|
|
132
|
+
te as default
|
|
132
133
|
};
|
package/dist/utils/constants.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l={xsm:0,sm:361,md:961,lg:1401,"snw-mobile":768};var s=(m=>(m.xsm="xsm",m.sm="sm",m.md="md",m.lg="lg",m.snwMobile="snw-mobile",m))(s||{});const e=16;exports.BREAKPOINTS=l;exports.Breakpoints=s;exports.DEFAULT_REM_SIZE=e;
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l = {
|
|
2
2
|
xsm: 0,
|
|
3
3
|
sm: 361,
|
|
4
4
|
md: 961,
|
|
5
5
|
lg: 1401,
|
|
6
6
|
// Temporary token for mobile breakpoint added to support [L3-7681](https://phillipsauctions.atlassian.net/browse/L3-7681)
|
|
7
7
|
"snw-mobile": 768
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
var s = /* @__PURE__ */ ((m) => (m.xsm = "xsm", m.sm = "sm", m.md = "md", m.lg = "lg", m.snwMobile = "snw-mobile", m))(s || {});
|
|
10
|
+
const x = 16;
|
|
9
11
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
l as BREAKPOINTS,
|
|
13
|
+
s as Breakpoints,
|
|
14
|
+
x as DEFAULT_REM_SIZE
|
|
12
15
|
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { Breakpoints } from './constants';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
export declare const px = "seldon";
|
|
3
4
|
/**
|
|
@@ -103,4 +104,3 @@ export declare const findChildrenOfType: <ComponentProps>(children: React.ReactN
|
|
|
103
104
|
export declare const findChildrenExcludingTypes: <ComponentProps>(children: React.ReactNode, excludedTypes: React.ElementType[]) => React.ReactElement<ComponentProps, string | React.JSXElementConstructor<any>>[] | null;
|
|
104
105
|
export declare const encodeURLSearchParams: (url: string) => string;
|
|
105
106
|
export declare const focusElementById: (elementId: string, focus: boolean) => void;
|
|
106
|
-
export {};
|